Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n;
  9.     cin >> n;
  10.     int *a = new int [n];
  11.     for (int i = 0; i < n; i++) {
  12.         cin >> a[i];
  13.     }
  14.     int cnt = 0;
  15.     for (int i = 1; i < n; i++) {
  16.         if (a[i - 1] < a[i]) {
  17.             cnt++;
  18.         }
  19.     }
  20.     cout << cnt;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement