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
27
28
29
30
31
32
#include <iostream>
#include <stdio.h>
using namespace std;
int a[1000000];
int main(){
int n, w = 0, e = 0;
cout << "Vvedite razmer 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; q++)
{
w = q - 1;
e = q + 1;
if (q == 0 && a[q] < a[e]){
cout << q;
break;
}
else if (q == n-1 && a[q] < a[w]){
cout << q;
break;
}
else if (a[q] < a[w] && a[q] < a[e]){
cout << q;
break;
}
}
}