#include <stdio.h>
struct Ans
{
int ansInt;
int isComp;
};
int main()
{
int n, i, m, isZero, A, B, j, index = 0;
while (scanf("%d", &n) == 1)
{
if (n == 0) break;
printf("Game %d:\n", ++ index);
struct Ans a[n];
for (i = 0; i < n; i ++)
{
scanf("%d", &m);
a[i].ansInt = m;
a[i].isComp = 0;
}
struct Ans b[n];
while (1)
{
isZero = 1, A = 0, B = 0;
for (i = 0; i < n; i ++)
{
scanf("%d", &m);
if (m != 0) isZero = 0;
b[i].ansInt = m;
b[i].isComp = 0;
a[i].isComp = 0;
}
for (i = 0; i < n; i ++)
if (a[i].ansInt == b[i].ansInt)
A ++, a[i].isComp = 1, b[i].isComp = 1;
for (i = 0; i < n; i ++)
for (j = 0; j < n; j ++)
{
if (i != j && a[i].isComp == 0 && b[j].isComp == 0 && a[i].ansInt == b[j].ansInt)
B ++, a[i].isComp = 1, b[j].isComp = 1;
}
if (isZero) break;
else printf(" (%d,%d)\n", A, B);
}
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言