// Online C++ compiler to run C++ program online #include <iostream> using namespace std; int a[11] = {0}; int b[11] = {0}; int main() { for(int i = 0; i < 18; i++){ int n; cin >> n; a[0] += n; if(n != 0){ a[n]++; } } for(int i = 0; i < 18; i++){ int n; cin >> n; b[0] += n; if(n != 0){ b[n]++; } } int n = 0; if(a[n] > b[n]){ cout << "Algosia\n"; return 0; }else if(a[n] < b[n]){ cout << "Bajtek\n"; return 0; } n = 10; while(n > 0){ if(a[n] > b[n]){ cout << "Algosia\n"; return 0; }else if(a[n] < b[n]){ cout << "Bajtek\n"; return 0; } n--; } cout << "remis\n"; }
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 | // Online C++ compiler to run C++ program online #include <iostream> using namespace std; int a[11] = {0}; int b[11] = {0}; int main() { for(int i = 0; i < 18; i++){ int n; cin >> n; a[0] += n; if(n != 0){ a[n]++; } } for(int i = 0; i < 18; i++){ int n; cin >> n; b[0] += n; if(n != 0){ b[n]++; } } int n = 0; if(a[n] > b[n]){ cout << "Algosia\n"; return 0; }else if(a[n] < b[n]){ cout << "Bajtek\n"; return 0; } n = 10; while(n > 0){ if(a[n] > b[n]){ cout << "Algosia\n"; return 0; }else if(a[n] < b[n]){ cout << "Bajtek\n"; return 0; } n--; } cout << "remis\n"; } |