#include <stdio.h> #define MAX_N 18 int tabA[]={0,0,0,0,0,0,0,0,0,0,0,0}; int tabB[]={0,0,0,0,0,0,0,0,0,0,0,0}; int x; int main() { for (int i=0;i<MAX_N;i++) { scanf("%d",&x); tabA[x]++; tabA[11]+=x; } for (int i=0;i<MAX_N;i++) { scanf("%d",&x); tabB[x]++; tabB[11]+=x; } for (int i=11;i>0;i--) { if(tabA[i]>tabB[i]) { printf("Algosia\n"); return 0; } if(tabB[i]>tabA[i]) { printf("Bajtek\n"); return 0; } } printf("remis\n"); 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 | #include <stdio.h> #define MAX_N 18 int tabA[]={0,0,0,0,0,0,0,0,0,0,0,0}; int tabB[]={0,0,0,0,0,0,0,0,0,0,0,0}; int x; int main() { for (int i=0;i<MAX_N;i++) { scanf("%d",&x); tabA[x]++; tabA[11]+=x; } for (int i=0;i<MAX_N;i++) { scanf("%d",&x); tabB[x]++; tabB[11]+=x; } for (int i=11;i>0;i--) { if(tabA[i]>tabB[i]) { printf("Algosia\n"); return 0; } if(tabB[i]>tabA[i]) { printf("Bajtek\n"); return 0; } } printf("remis\n"); return 0; } |