25 lines
450 B
C++
25 lines
450 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int n;
|
|
cin >> n;
|
|
int a[1000] = {0};
|
|
for (int i = 0; i < n; i++) {
|
|
cin >> a[i];
|
|
}
|
|
int x;
|
|
cin >> x;
|
|
bool found = false;
|
|
for (int i = 0; i < n; i++) {
|
|
if (a[i] == x) {
|
|
cout << i + 1 << endl;
|
|
found = true;
|
|
break;
|
|
}
|
|
}
|
|
if (!found) cout << -1 << endl;
|
|
return 0;
|
|
}
|