#include <iostream> using namespace std; int t[18]; int y[18]; int c[10]; int b[10]; int a = 0, s = 0; int main() { for (int i = 0; i < 18; i++) { cin >> t[i]; s += t[i]; b[t[i]]++; } for (int i = 0; i < 18; i++) { cin >> y[i]; a += y[i]; c[y[i]]++; } if (s > a) { cout << "Algosia"; } else if (s < a) { cout << "Bajtek"; } else { bool remis = false; for (int i = 10; i >0; i--) {if (b[i] == c[i]&&i==1) { remis = true; cout << "remis"; break;} }} 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 | #include <iostream> using namespace std; int t[18]; int y[18]; int c[10]; int b[10]; int a = 0, s = 0; int main() { for (int i = 0; i < 18; i++) { cin >> t[i]; s += t[i]; b[t[i]]++; } for (int i = 0; i < 18; i++) { cin >> y[i]; a += y[i]; c[y[i]]++; } if (s > a) { cout << "Algosia"; } else if (s < a) { cout << "Bajtek"; } else { bool remis = false; for (int i = 10; i >0; i--) {if (b[i] == c[i]&&i==1) { remis = true; cout << "remis"; break;} }} return 0; } |