Praktikum_mf

Базовые алгоритмы/Алгоритмы count и count_if/Задание 1

Sep 30th, 2021
387
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. }
Advertisement
Add Comment
Please, Sign In to add comment