代码:
#include <cstdio>
#include <fstream>
#include <map>
#include <string>
#include <iostream>
using namespace std;
const int maxn = 90;
int main(){
// freopen("a.txt", "r", stdin);
int n;
int a[maxn];
while(cin >> n){
for(int i = 0; i < n; ++i){
cin >> a[i];
}
for(int i = 0; i < n; ++i){
if(i == 0){
if(a[i] != a[i + 1]){
cout << i;
}
}
else if(i != n - 1){
if( (a[i + 1] - a[i]) * (a[i - 1] - a[i]) > 0){
cout << " " << i;
}
}
else{
if(a[i] != a[i - 1]){
cout << " " << i;
}
}
}
cout << endl;
}
return 0;
}