Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44253 | 承诺 | 查找特定的值 | C++ | Accepted | 0 MS | 248 KB | 260 | 2024-03-29 15:50:20 |
#include<bits/stdc++.h> using namespace std; int main(){ string s=""; int n,m; cin>>n; for(int i=1;i<=n;i++){ int x; cin>>x; s+=x+'0'; } cin>>m; char ss='0'+m; int a=s.find(ss); if(a==-1) cout<<-1; else cout<<a+1; return 0; }