You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
284 B

#include<bits/stdc++.h>
using namespace std;
int main() {
int n,b,i;
scanf("%d",&n);
int a[n+1];
for(i=1; i<=n; i++)
scanf("%d",&a[i]);
scanf("%d",&b);
for(i=1; i<=n; i++) {
if(b==a[i]) {
printf("%d\n",i);
break;
}
}
if(i==n+1) {
printf("-1");
}
return 0;
}