#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int n, game = 1;
while (cin >> n && n != 0)
{
vector<int>secret;
int temp;
cout << "Game " << game++ << ":" << endl;
for (int i = 0; i < n; ++i)
{
cin >> temp;
secret.push_back(temp);
}
int absSum;
do
{
int strong = 0, weak = 0, re = 0;
vector<int>guess;
absSum = 0;
for (int i = 0; i < n; ++i)
{
cin >> temp;
if (temp == secret[i]) ++strong;
guess.push_back(temp);
absSum += abs(temp);
}
if (absSum != 0)
{
for (int i = 1; i <= 9; ++i)
{
int s = 0, g = 0;
for (int j = 0; j < n; ++j)
{
if (i == secret[j])
++s;
if (i == guess[j])
++g;
}
re += min(s, g);
}
weak = re - strong;
cout << " (" << strong << ',' << weak << ')' << endl;
}
} while (absSum != 0);
}
}
注意左括号前有四个空格…