#include <iostream> using namespace std; int tal[18], tab[18], d, dz, o, s, sz, pt, cz, t, dw, j, alg, baj, d2, dz2, o2, s2, sz2, pt2, cz2, t2, dw2, j2, z, z2; int main() { ios_base::sync_with_stdio(0); for(int i; i<18 ; i++) { cin>>tal[i]; alg=alg+tal[i]; if(tal[i]==10) d++; if(tal[i]==9) dz++; if(tal[i]==8) o++; if(tal[i]==7) s++; if(tal[i]==6) sz++; if(tal[i]==5) pt++; if(tal[i]==4) cz++; if(tal[i]==3) t++; if(tal[i]==2) dw++; if(tal[i]==1) j++; if(tal[i]==0) z++; } for(int i; i<18 ; i++) { cin>>tab[i]; baj=baj+tab[i]; if(tab[i]==10) d2++; if(tab[i]==9) dz2++; if(tab[i]==8) o2++; if(tab[i]==7) s2++; if(tab[i]==6) sz2++; if(tab[i]==5) pt2++; if(tab[i]==4) cz2++; if(tab[i]==3) t2++; if(tab[i]==2) dw2++; if(tab[i]==1) j2++; if(tab[i]==0) z++; } if(baj>alg) cout<<"Bajtek"; else if(alg>baj) cout<<"Algosia"; else if (alg==baj) { if(d>d2) cout<<"Algosia"; else if(d<d2) cout<<"Bajtek"; else if(dz>dz2) cout<<"Algosia"; else if(dz<dz2) cout<<"Bajtek"; else if(o>o2) cout<<"Algosia"; else if(o<o2) cout<<"Bajtek"; else if(s>s2) cout<<"Algosia"; else if(s<s2) cout<<"Bajtek"; else if(sz>sz2) cout<<"Algosia"; else if(sz<sz2) cout<<"Bajtek"; else if(pt>pt2) cout<<"Algosia"; else if(pt<pt2) cout<<"Bajtek"; else if(cz>cz2) cout<<"Algosia"; else if(cz<cz2) cout<<"Bajtek"; else if(t>t2) cout<<"Algosia"; else if(t<t2) cout<<"Bajtek"; else if(dw>dw2) cout<<"Algosia"; else if(dw<dw2) cout<<"Bajtek"; else if(j>j2) cout<<"Algosia"; else if(j<j2) cout<<"Bajtek"; else cout<<"remis"; } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #include <iostream> using namespace std; int tal[18], tab[18], d, dz, o, s, sz, pt, cz, t, dw, j, alg, baj, d2, dz2, o2, s2, sz2, pt2, cz2, t2, dw2, j2, z, z2; int main() { ios_base::sync_with_stdio(0); for(int i; i<18 ; i++) { cin>>tal[i]; alg=alg+tal[i]; if(tal[i]==10) d++; if(tal[i]==9) dz++; if(tal[i]==8) o++; if(tal[i]==7) s++; if(tal[i]==6) sz++; if(tal[i]==5) pt++; if(tal[i]==4) cz++; if(tal[i]==3) t++; if(tal[i]==2) dw++; if(tal[i]==1) j++; if(tal[i]==0) z++; } for(int i; i<18 ; i++) { cin>>tab[i]; baj=baj+tab[i]; if(tab[i]==10) d2++; if(tab[i]==9) dz2++; if(tab[i]==8) o2++; if(tab[i]==7) s2++; if(tab[i]==6) sz2++; if(tab[i]==5) pt2++; if(tab[i]==4) cz2++; if(tab[i]==3) t2++; if(tab[i]==2) dw2++; if(tab[i]==1) j2++; if(tab[i]==0) z++; } if(baj>alg) cout<<"Bajtek"; else if(alg>baj) cout<<"Algosia"; else if (alg==baj) { if(d>d2) cout<<"Algosia"; else if(d<d2) cout<<"Bajtek"; else if(dz>dz2) cout<<"Algosia"; else if(dz<dz2) cout<<"Bajtek"; else if(o>o2) cout<<"Algosia"; else if(o<o2) cout<<"Bajtek"; else if(s>s2) cout<<"Algosia"; else if(s<s2) cout<<"Bajtek"; else if(sz>sz2) cout<<"Algosia"; else if(sz<sz2) cout<<"Bajtek"; else if(pt>pt2) cout<<"Algosia"; else if(pt<pt2) cout<<"Bajtek"; else if(cz>cz2) cout<<"Algosia"; else if(cz<cz2) cout<<"Bajtek"; else if(t>t2) cout<<"Algosia"; else if(t<t2) cout<<"Bajtek"; else if(dw>dw2) cout<<"Algosia"; else if(dw<dw2) cout<<"Bajtek"; else if(j>j2) cout<<"Algosia"; else if(j<j2) cout<<"Bajtek"; else cout<<"remis"; } return 0; } |