#include"iostream" #include"cctype" #include"cstring" using namespace std; #define max 1010 //#define local #define local1 int num[10]; int main() { #ifdef local1 FILE *fin,*fout; fin=fopen("UVA.in","rb"); fout=fopen("UVA.out","wb"); #endif #ifdef local freopen("UVA.txt","r",stdin); freopen("UVA.txt","w",stdout); #endif int n,tc=0,c1=0,c2=0; while(scanf("%d",&n)!=EOF&&n!=0) { int ans[n],que[n],a,b; printf("Game %d: ",++tc); for(int i=0;i<n;i++){ scanf("%d",&ans[i]); } while(!(a==4&&b==0)) { a=0,b=0; for(int i=0;i<n;i++){ scanf("%d",&que[i]); if(ans[i]==que[i]) a++; } if(que[0]==0) break; for(int j=1;j<10;j++) { c1=0,c2=0; for(int l=0;l<n;l++) { if(ans[l]==j)c1++; if(que[l]==j)c2++; } b+=(c1<c2)?c1:c2; } printf(" (%d,%d) ",a,b-a); } } return 0; }
说明UVA禁止输入输出重定向