Aozzi

Untitled

Nov 30th, 2021
712
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main()
  5. {
  6.     int number, k, counter = 0;
  7.     std::vector<int> arr;
  8.     std::cin >> number;
  9.     for (int i = 0; i < number; i++) {
  10.         std::cin >> k;
  11.         arr.push_back(k);
  12.     }
  13.     std::cin >> k;
  14.  
  15.     for (int& i : arr) {
  16.         if (i > k) {
  17.             counter++;
  18.             k = i;
  19.         }
  20.     }
  21.     std::cout << counter;
  22.  
  23. }
  24.  
RAW Paste Data