RobertDeMilo

Основы С++2.3 Алгоритмы count и count_if / Задача 1

Sep 23rd, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. void PrintWorryCount(const vector<bool>& is_nervous) {
  8.     cout << count(is_nervous.begin(), is_nervous.end(), true) << endl;
  9. }
  10.  
  11. int main() {
  12.     // не меняйте содержимое функции main
  13.     PrintWorryCount({true, true, false, true});
  14.     return 0;
  15. }
Tags: count count_if
Add Comment
Please, Sign In to add comment