#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
int n, k=0, times;
cin>>n;
cin>>line;
for (int i = 0 ; i< n*8; i++) {
if (line[i] == '1') {
k++;
}
}
if (k < 3*n) {
cout<<"NIE"<<endl;
return 0;
}
if (k==3) {
cout<<"a"<<endl;
} else if (k==4) {
cout<<"c"<<endl;
} else if (k==5) {
cout<<"e"<<endl;
} else if (k==6) {
cout<<"o"<<endl;
} else if (k==7) {
cout<<"ac"<<endl;
} else if (k==8) {
cout<<"cc"<<endl;
} else if (k==9) {
cout<<"ce"<<endl;
} else if (k==10) {
cout<<"ee"<<endl;
} else if (k==11) {
cout<<"no"<<endl;
} else if (k==12) {
cout<<"oo"<<endl;
} else {
cout<<"XDD"<<endl;
}
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 | #include <iostream> #include <string> using namespace std; int main() { string line; int n, k=0, times; cin>>n; cin>>line; for (int i = 0 ; i< n*8; i++) { if (line[i] == '1') { k++; } } if (k < 3*n) { cout<<"NIE"<<endl; return 0; } if (k==3) { cout<<"a"<<endl; } else if (k==4) { cout<<"c"<<endl; } else if (k==5) { cout<<"e"<<endl; } else if (k==6) { cout<<"o"<<endl; } else if (k==7) { cout<<"ac"<<endl; } else if (k==8) { cout<<"cc"<<endl; } else if (k==9) { cout<<"ce"<<endl; } else if (k==10) { cout<<"ee"<<endl; } else if (k==11) { cout<<"no"<<endl; } else if (k==12) { cout<<"oo"<<endl; } else { cout<<"XDD"<<endl; } return 0; } |
English