include iostream include stdio using namespace std int 1000000 int mai

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <stdio.h>
using namespace std;
int a[1000000];
int main(){
int count = 0, n;
bool check = false;
cout << "Vvedite razmernost massiva" << endl;
cin >> n;
cout << "Vvedite elementi massiva" << endl;
for (int q=0; q<n; q++){
cin >> a[q];
}
for (int q=0; q<n-1; q++){
check = false;
while (a[q+1] < a[q]){
check = true;
q++;
}
if (check == true)
count ++;
}
cout << count << endl;
}