22219 定位查找
定位查找
https://ac.nowcoder.com/acm/problem/22219
#include<iostream> using namespace std; int main() { int n, m, f; while(cin>>n) { f=0; 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<<endl; f=1; break; } } if(f==0) cout<<"No"<<endl; } }