#include <iostream>
using namespace std;
int A_points, B_points, A=0, B=0;
int A2[11];
int B2[11];
int q = 10;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
for(int i=0; i<11; i++)
{
A2[i]=0;
B2[i]=0;
}
for(int i=0; i<18; i++)
{
cin>>A_points;
A = A+A_points;
A2[A_points]++;
}
for(int i=0; i<18; i++)
{
cin>>B_points;
B = B+B_points;
B2[B_points]++;
}
while(q>=0)
{
if (A > B)
{
cout<<"Algosia";
return 0;
}
else if (A < B)
{
cout<<"Bajtek";
return 0;
}
else
{
A = A2[q];
B = B2[q];
q--;
}
}
cout<<"remis";
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #include <iostream> using namespace std; int A_points, B_points, A=0, B=0; int A2[11]; int B2[11]; int q = 10; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for(int i=0; i<11; i++) { A2[i]=0; B2[i]=0; } for(int i=0; i<18; i++) { cin>>A_points; A = A+A_points; A2[A_points]++; } for(int i=0; i<18; i++) { cin>>B_points; B = B+B_points; B2[B_points]++; } while(q>=0) { if (A > B) { cout<<"Algosia"; return 0; } else if (A < B) { cout<<"Bajtek"; return 0; } else { A = A2[q]; B = B2[q]; q--; } } cout<<"remis"; return 0; } |
English