//{{{ #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(I,A,B) for(int I=(A);I<(B);I++) #define FORD(I,A,B) for(int I=(A);I>=(B);I--) #define REP(I,N) for(int I=0;i<(N);i++) #define VAR(V,init) __typeof(init) V=(init) #define FOREACH(I,C) for(VAR(I,(C).begin());I!=(C).end();I++) #define CLR(A,v) memset((A),v,sizeof((A))) #define ALL(X) (X).begin(), (X).end() #define PB push_back #define MP make_pair #define FI first #define SE second //}}} char *LEN[]={"Chech","Engilsh","French","German","Hungarian","Italian","Japanese","Polish","Spanish"}; char *code[]={"cs","en","fr","de","hu","hu","it","it","jp","pl","es"}; char *R[]={"Kamen","Rock","Pierre","Stein","Ko","Koe","Sasso","Roccia","Guu","Kamien","Piedra"}; char *S[]={"Nuzky","Scissors","Ciseaux","Schere","Ollo","Olloo","Forbice","Forbice","Choki","Nozyce","Tijera"}; char *P[]={"Papir","Paper","Feuille","Papier","Papir","Papir","Carta","Rete","Paa","Papier","Papel"}; int NT[]={0,1,2,3,4,4,5,5,6,7,8}; int WN[]={1,2,0}; int nation(char *s) { REP(i,11) if (strcmp(s,code[i])==0) return NT[i]; return 0; } int what(int nat,char *s) { REP(i,11) if (NT[i]==nat && strcmp(s,R[i])==0) return 0; REP(i,11) if (NT[i]==nat && strcmp(s,S[i])==0) return 1; REP(i,11) if (NT[i]==nat && strcmp(s,P[i])==0) return 2; return 0; } int main() { int game=1; int nat[2]; char typ[2][100]; char nm[2][100]; char n[2][20]; bool con=1; int res1=0,res2=0; while (con) { scanf("%s%s",n[0],nm[0]); scanf("%s%s",n[1],nm[1]); nat[0]=nation(n[0]); nat[1]=nation(n[1]); for(;;) { scanf("%s",typ[0]); if (typ[0][0]=='-' || typ[0][0]=='.') { if (typ[0][0]=='.') con=false; printf("Game #%d:\n",game); printf("%s: %d point%s\n",nm[0],res1,res1!=1?"s":""); printf("%s: %d point%s\n",nm[1],res2,res2!=1?"s":""); if (res1==res2) printf("TIED GAME\n"); else printf("WINNER: %s\n",res1>res2?nm[0]:nm[1]); printf("\n"); game++; res1=res2=0; break; } else { scanf("%s",typ[1]); int p1,p2; p1=what(nat[0],typ[0]); p2=what(nat[1],typ[1]); if (WN[p1]==p2) res1++; if (WN[p2]==p1) res2++; } } } return 0; }