#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef long double LD; typedef vector VI; typedef pair PII; typedef vector VPII; #define MP make_pair #define ST first #define ND second #define PB push_back #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 ALL(X) (X).begin(),(X).end() #define SIZE(X) (int)(X).size() #define FOREACH(it,X) for(__typeof((X).begin()) it=(X).begin(); it!=(X).end(); ++it) string kody[]={"cs","en","fr","de","hu","it","jp","pl","es"}; string nazwy[9][3]={ {"Kamen","Nuzky","Papir"}, {"Rock","Scissors","Paper"}, {"Pierre","Ciseaux","Feuille"}, {"Stein","Schere","Papier"}, {"Ko","Ollo","Papir"}, {"Sasso","Forbice","Carta"}, {"Guu","Choki","Paa"}, {"Kamien","Nozyce","Papier"}, {"Piedra","Tijera","Papel"}, }; int zamien(int kod,string s){ if (s=="Koe" || s=="Roccia") return 0; if (s=="Olloo") return 1; if (s=="Rete") return 2; REP(i,3) if (nazwy[kod][i]==s) return i; printf("ERROR\n"); return 0; } char txt2[1000]; string wczytaj_imie(){ scanf("%s",txt2); return txt2; } int wczytaj_kod(){ scanf("%s",txt2); string s=txt2; REP(i,9) if (kody[i]==s) return i; printf("ERROR kody\n"); return 0; } char txt[100]; int main(){ int gra=0; do{ int kod1=wczytaj_kod(); string imie1=wczytaj_imie(); int kod2=wczytaj_kod(); string imie2=wczytaj_imie(); int punkty[2]={0,0}; while (scanf("%s",txt),(txt[0]!='-' && txt[0]!='.')){ int co1=zamien(kod1,txt); scanf("%s",txt); int co2=zamien(kod2,txt); if (co1==0 && co2==1 || co1==1 && co2==2 || co1==2 && co2==0) punkty[0]++; if (co2==0 && co1==1 || co2==1 && co1==2 || co2==2 && co1==0) punkty[1]++; } printf("Game #%d:\n",++gra); printf("%s: %d point",imie1.c_str(),punkty[0]); if (punkty[0]!=1) printf("s"); puts(""); printf("%s: %d point",imie2.c_str(),punkty[1]); if (punkty[1]!=1) printf("s"); puts(""); if (punkty[0]==punkty[1]) puts("TIED GAME"); else if (punkty[0]>punkty[1]) printf("WINNER: %s\n",imie1.c_str()); else printf("WINNER: %s\n",imie2.c_str()); puts(""); } while (txt[0]!='.'); return 0; }