You are on page 1of 1

#include <iostream>

#include <cstring>

using namespace std;

int main()
{
int i=0,j=0,cnt=0,oka=0,okb=0,okc=0,nr=0,nrc=0;
char a[100],b[100],c[100];
//while(1){
while(cin >> a >> b >> c){
//cin >> a >> b >> c;
oka=0,okb=0,okc=0;
if(strstr(a,"AB") == a || strstr(a,"AR") == a || strstr(a,"AG") == a ||
strstr(a,"B") == a || strstr(a,"BC") == a || strstr(a,"BH") == a || strstr(a,"BN")
== a || strstr(a,"BT") == a || strstr(a,"BV") == a || strstr(a,"BR") == a ||
strstr(a,"BZ") == a || strstr(a,"CS") == a || strstr(a,"CL") == a || strstr(a,"CJ")
== a || strstr(a,"CT") == a || strstr(a,"CV") == a || strstr(a,"DB") == a ||
strstr(a,"DJ") == a || strstr(a,"GL") == a || strstr(a,"GJ") == a || strstr(a,"HR")
== a || strstr(a,"HD") == a || strstr(a,"IL") == a || strstr(a,"IS") == a ||
strstr(a,"IF") == a || strstr(a,"MM") == a || strstr(a,"MH") == a || strstr(a,"MS")
== a || strstr(a,"NT") == a || strstr(a,"OT") == a || strstr(a,"PH") == a ||
strstr(a,"SM") == a || strstr(a,"SJ") == a || strstr(a,"SB") == a || strstr(a,"SV")
== a || strstr(a,"TR") == a || strstr(a,"TM") == a || strstr(a,"TL") == a ||
strstr(a,"VS") == a || strstr(a,"VL") == a || strstr(a,"VN") == a){
oka=1;
}
nr=strlen(b);
while(b[j]!='\0'){
if(isdigit(b[i]))
++cnt;
++j;
}
//cout << cnt << ' ' << nr;
if(cnt == nr){
if(cnt == 1 || cnt == 2 || cnt == 3)
okb=1;
}
nrc=strlen(c);
cnt=0;
while(c[i]!='\0'){
if(isupper(c[i]))
++cnt;
++i;
}
//cout << nrc << ' ' << cnt;
if(nrc == cnt)
okc=1;
//cout << oka << ' ' << okb << ' ' << okc;
if(oka && okb && okc)
cout << a << ' ' << b << ' ' << c;
}
return 0;
}

You might also like