#include <iostream>
using namespace std;
short A[12], B[12], f=11;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
for(short i=0, k; i<18; ++i){
cin>>k;
A[11]=A[11]+k;
A[k]++;
}
for(short i=0, k; i<18; ++i){
cin>>k;
B[11]=B[11]+k;
B[k]++;
}
while(f){
if(A[f]>B[f]){
cout<<"Algosia";
return 0;
}
if(A[f]<B[f]){
cout<<"Bajtek";
return 0;
}
--f;
}
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 | #include <iostream> using namespace std; short A[12], B[12], f=11; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for(short i=0, k; i<18; ++i){ cin>>k; A[11]=A[11]+k; A[k]++; } for(short i=0, k; i<18; ++i){ cin>>k; B[11]=B[11]+k; B[k]++; } while(f){ if(A[f]>B[f]){ cout<<"Algosia"; return 0; } if(A[f]<B[f]){ cout<<"Bajtek"; return 0; } --f; } cout<<"remis"; return 0; } |
English