Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
61066 | zhangweiran | 查找特定的值 | C++ | Accepted | 0 MS | 244 KB | 345 | 2025-02-21 21:51:33 |
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n; int a[n]; for(int i = 0; i < n; i++){ cin >> a[i]; } cin >> m; for(int i = 0; i < n; i++){ if(a[i] == m){ cout << i + 1 << endl; return 0; } } cout << -1 << endl; return 0; }