1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; long long n,m,a,s; int main() { cin>>n>>m; for(int i=1;i<=n;i++) { cin>>a; if(a==m) { s++; cout<<i<<endl; } } if(s==0)cout<<"NOBODY"; else cout<<"zongshu:"<<s; return 0; }Pascal :
var i,j,k,n,m:longint; s:array [1..10000] of longint; begin readln(n,m); for i:=1 to n do read(s[i]); for i:=1 to n do if s[i]=m then begin writeln(i); k:=k+1; end; if k<>0 then write('zongshu:',k) else write('NOBODY'); end.
- 1
Information
- ID
- 18036
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By