参考:https://blog.csdn.net/q547550831/article/details/51326321
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define N 10000
int main()
{
int n,q,count=; while (scanf("%d %d",&n,&q)!=EOF)
{
if (n==&&q==)
{
break;
}
int m[N];
int i;
for (i=;i<n;i++)
{
scanf("%d",&m[i]);
}
sort(m,m+n);
printf("CASE# %d:\n",++count);//此行要放在while前面!!!
while (q--)
{
int temp;
scanf("%d",&temp);
int t=lower_bound(m,m+n,temp)-m;
if (m[t]==temp)
{
printf("%d found at %d\n",temp,t+);
}
else
{
printf("%d not found\n",temp);
}
}
} return ;
}