• + 1 comment

    Here i use c++ 20, what do you think guys?

    void countApplesAndOranges(int s, int t, int a, int b, vector apples, vector oranges) { int sumApple = 0; int sumOrange = 0;

    for (int i = 0; i < apples.size(); i++) {
        apples[i] += a;
        if (apples[i] >= s && apples[i] <= t ) {
            sumApple++;
        }
    }
    for (int j = 0; j < oranges.size(); j++) {
        oranges[j] += b;
        if (oranges[j] >= s && oranges[j] <= t) {
            sumOrange++;
        }
    }
    cout << sumApple << "\n" << sumOrange << endl; 
    

    }