#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--){
char a[100];
cin>>a;
// cout <<a[0]<<a[1];
if((a[0]-'0')*10+(a[1]-'0') == 33){
cout <<"He/She is from Zhejiang,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 11){
cout <<"He/She is from Beijing,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 71){
cout <<"He/She is from Taiwan,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 81){
cout <<"He/She is from Hong Kong,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 82){
cout <<"He/She is from Macao,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 54){
cout <<"He/She is from Tibet,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 21){
cout <<"He/She is from Liaoning,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
else if((a[0]-'0')*10+(a[1]-'0') == 31){
cout <<"He/She is from Shanghai,and his/her birthday is on "<<a[10]<<a[11]<<","<<a[12]<<a[13]<<","<<a[6]<<a[7]<<a[8]<<a[9]<<" based on the table." << endl;
}
}
return 0;
}
杭电OJ2629C++
最新推荐文章于 2021-12-08 23:24:30 发布