You are viewing a single comment's thread. Return to all comments →
void countApplesAndOranges(int s, int t, int a, int b, vector<int> apples, vector<int> oranges) { int ca = 0, cb =0; for(int i =0; i<apples.size();i++){ apples[i]+=a; if(apples[i]>=s && apples[i]<=t){ ca++; } } for(int i=0;i<oranges.size();i++){ oranges[i] = b+oranges[i]; if(oranges[i]<=t && oranges[i]>=s){ cb++; } }
cout<<ca<<endl<<cb;
}
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 →
C++
}