#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
int n, k, tmp;
int j = 1;
while (cin >> n >> k)
{
if (n == 0 && k == 0)
break;
vector<int> a;
vector<int> q;
for (int i = 0; i < n; i++)
{
cin >> tmp;
a.push_back(tmp);
}
for (int i = 0; i < k; i++)
{
cin >> tmp;
q.push_back(tmp);
}
sort(a.begin(), a.end());
cout << "CASE# " << j << ":" << endl;
j++;
for (int i = 0; i < k; i++)
{
bool flag = false;
for (int x = 0; x < a.size(); x++)
{
if (a[x] == q[i])
{
flag = true;
cout << q[i] << " found at " << x + 1 << endl;
break;
}
}
if (!flag)
cout << q[i] << " not found " << endl;
}
}
return 0;
}
大佬看看这个WA的代码,(Wonderful Answer)