Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54312 | zhangweiran | 查找特定的值 | C++ | Accepted | 0 MS | 252 KB | 345 | 2024-10-27 10:01:40 |
#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; }