Is there a more concise way of counting all the elements of a vector (here in the example between 10 and 20) than the one presented?
vector<int> v={1,2,3,45,24,10,20,-90,100,18,17,15,87};
int n;
for (int i=0;i<v.size();i++){
if (v[i]>=10 && v[i]<=20)
n++;
}
cout << n;