Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54310 | 张思存 | 查找特定的值 | C++ | Accepted | 0 MS | 248 KB | 345 | 2024-10-27 09:56:16 |
#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; }