all_of, any_of, none_of

include

include

include

include

include

include

using namespace std;
int main(){
vector v(10, 2);
for(int n : v){
cout << n << ” “;
}
cout << endl;

partial_sum(v.cbegin(), v.cend(), v.begin());

cout << “Among the numbers: “;
copy(v.cbegin(), v.cend(), ostream_iterator(cout, ” “));
cout << endl;

if (all_of(v.cbegin(), v.cend(), [](int i){ return i % 2 == 0; })) {
cout << “All numbers are even”<

你可能感兴趣的:(all_of, any_of, none_of)