#include <cstdio> #include <cstring> int main() { char a[][12] = {"aaaaaaaaaaa", "aaaaaaaaaaa"}; char r[][8] = {"Algosia", "remis", "Bajtek"}; int n, s[] = {0, 0}; for (int j = 0; j<2; j++) for (int i = 0; i<18; i++) { scanf("%i", &n); a[j][10-n]++; s[j] += n; } if (s[0] == s[1]) s[0] += strcmp(a[0], a[1]); puts(r[1+(s[0]<s[1])-(s[0]>s[1])]); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <cstdio> #include <cstring> int main() { char a[][12] = {"aaaaaaaaaaa", "aaaaaaaaaaa"}; char r[][8] = {"Algosia", "remis", "Bajtek"}; int n, s[] = {0, 0}; for (int j = 0; j<2; j++) for (int i = 0; i<18; i++) { scanf("%i", &n); a[j][10-n]++; s[j] += n; } if (s[0] == s[1]) s[0] += strcmp(a[0], a[1]); puts(r[1+(s[0]<s[1])-(s[0]>s[1])]); return 0; } |