提交时间:2024-01-25 08:19:40

运行 ID: 127189

#include <bits/stdc++.h> using namespace std; int a[10010]; int n, m; int main (){ ios::sync_with_stdio(false); cin.tie(0); scanf("%d", &n); for (int i = 1; i <= n; i++){ scanf("%d", &a[i]); } scanf("%d", &m); for (int i = 1; i <= n; i++){ if (a[i] == m){ printf("%d", i); return 0; } } printf("-1"); return 0; }