You are viewing a single comment's thread. Return to all comments →
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;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
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;
}