标签:io for amp as br ca return print c
#include<stdio.h>
int main()
{
int m,i,x,n=0;
int a[1010],b[1010];
while(scanf("%d",&m)&&m)
{
printf("Game %d:\n",++n);
for(i=0; i<m; i++)
scanf("%d",&a[i]);
while(1)
{
int k=0;
int B=0;
int A=0;
for(i=0; i<m; i++)
{
scanf("%d",&b[i]);
if(b[i]==0)
k++;
}
if(k==m)
break;
for(i=0; i<m; i++)
{
if(a[i]==b[i])
A++;
}
for(x=1; x<=9; x++)
{
int c1=0;
int c2=0;
for(i=0; i<m; i++)
{
if(a[i]==x)
c1++;
if(b[i]==x)
c2++;
}
c1<c2?(B+=c1):(B+=c2);
}
printf(" (%d,%d)\n",A,B-A);
}
}
return 0;
}
标签:io for amp as br ca return print c
原文地址:http://www.cnblogs.com/YanMings/p/4170566.html