-
Notifications
You must be signed in to change notification settings - Fork 14
/
10474.cpp
32 lines (32 loc) · 1.1 KB
/
10474.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
for(int z=1;;z++){
int n,query,i;
scanf("%d%d",&n,&query);
if(n==0 && query==0)
break;
int num[n];
for(i=0;i<n;i++)
scanf("%d",&num[i]);
sort(num,num+n);
printf("CASE# %d:\n",z);
while(query--){
int find,ctr=0;
scanf("%d",&find);
for(i=0;i<n;i++){
if(num[i]==find){
printf("%d found at %d\n",find,i+1);
ctr=-1;
break;
}
}
if(ctr>=0)
printf("%d not found\n",find);
}
}
return 0;
}