提交时间:2023-10-30 21:14:35

运行 ID: 29523

#include <bits/stdc++.h> using namespace std; int a[10001]; int main(){ int n; cin >> n; for(int i = 1; i <= n; i ++){ cin >> a[i]; } int x, y = 0; cin >> x; for(int i = 1; i <= n; i++){ y = 0; if(x == a[i]){ cout << i; y = 1; break; } } if(y = 0){ cout << "-1"; } return 0; }