#include <iostream> using namespace std; int t1[20], t2[20]; int s1, s2; int c1[20], c2[20]; int main() { for(int i = 0; i < 18; i++) { cin >> t1[i];\ s1 += t1[i]; c1[t1[i]]++; } for(int i = 0; i < 18; i++) { cin >> t2[i]; s2 += t2[i]; c2[t2[i]]++; } if(s1 > s2) { cout << "Algosia"; return 0; } if(s1 < s2) { cout << "Bajtek"; return 0; } for(int i = 10; i > 0; i--) { if(c1[i] > c2[i]) { cout << "Algosia"; return 0;} if(c1[i] < c2[i]) { cout << "Bajtek"; return 0; } } cout << "remis"; } //10 10 7 10 10 10 10 10 10 10 10 10 0 10 4 10 10 10 //10 10 10 10 10 10 10 10 10 10 10 10 4 3 4 10 10 10
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 | #include <iostream> using namespace std; int t1[20], t2[20]; int s1, s2; int c1[20], c2[20]; int main() { for(int i = 0; i < 18; i++) { cin >> t1[i];\ s1 += t1[i]; c1[t1[i]]++; } for(int i = 0; i < 18; i++) { cin >> t2[i]; s2 += t2[i]; c2[t2[i]]++; } if(s1 > s2) { cout << "Algosia"; return 0; } if(s1 < s2) { cout << "Bajtek"; return 0; } for(int i = 10; i > 0; i--) { if(c1[i] > c2[i]) { cout << "Algosia"; return 0;} if(c1[i] < c2[i]) { cout << "Bajtek"; return 0; } } cout << "remis"; } //10 10 7 10 10 10 10 10 10 10 10 10 0 10 4 10 10 10 //10 10 10 10 10 10 10 10 10 10 10 10 4 3 4 10 10 10 |