#include<iostream>
#include<map>
using namespace std;
map<string,short> mapa;
short lzad;
int main(){
mapa["1A"]=0;
mapa["1B"]=0;
mapa["1C"]=0;
mapa["2A"]=0;
mapa["2B"]=0;
mapa["2C"]=0;
mapa["3A"]=0;
mapa["3B"]=0;
mapa["3C"]=0;
mapa["4A"]=0;
mapa["4B"]=0;
mapa["4C"]=0;
mapa["5A"]=0;
mapa["5B"]=0;
mapa["5C"]=0;
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>lzad;
for(int i=0;i<lzad;i++){
string zad;
cin>>zad;
mapa[zad]++;
}
if(mapa["1A"]>0&&mapa["1B"]>0&&mapa["1C"]>0&&mapa["2A"]>0&&mapa["2B"]>0&&mapa["2C"]>0&&mapa["3A"]>0&&mapa["3B"]>0&&mapa["3C"]>0&&mapa["4A"]>0&&mapa["4B"]>0&&mapa["4C"]>0&&mapa["5A"]>1&&mapa["5B"]>1&&mapa["5C"]>1)
cout<<"TAK";
else
cout<<"NIE";
}
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> #include<map> using namespace std; map<string,short> mapa; short lzad; int main(){ mapa["1A"]=0; mapa["1B"]=0; mapa["1C"]=0; mapa["2A"]=0; mapa["2B"]=0; mapa["2C"]=0; mapa["3A"]=0; mapa["3B"]=0; mapa["3C"]=0; mapa["4A"]=0; mapa["4B"]=0; mapa["4C"]=0; mapa["5A"]=0; mapa["5B"]=0; mapa["5C"]=0; ios_base::sync_with_stdio(0); cin.tie(0); cin>>lzad; for(int i=0;i<lzad;i++){ string zad; cin>>zad; mapa[zad]++; } if(mapa["1A"]>0&&mapa["1B"]>0&&mapa["1C"]>0&&mapa["2A"]>0&&mapa["2B"]>0&&mapa["2C"]>0&&mapa["3A"]>0&&mapa["3B"]>0&&mapa["3C"]>0&&mapa["4A"]>0&&mapa["4B"]>0&&mapa["4C"]>0&&mapa["5A"]>1&&mapa["5B"]>1&&mapa["5C"]>1) cout<<"TAK"; else cout<<"NIE"; } |
English