http://acm.hdu.edu.cn/showproblem.php?pid=2629
地区只要看前两位就可以了,因为地区是个大的概念后面的数字代表的是县
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(void)
{
int n; cin>>n;
while(n--)
{
string s; cin>>s;
string area=s.substr(0,2);
string year=s.substr(6,4);
string month=s.substr(10,2);
string day=s.substr(12,2);
if(area=="33") area="Zhejiang";
if(area=="82") area="Macao";
if(area=="11") area="Beijing";
if(area=="54") area="Tibet";
if(area=="71") area="Taiwan";
if(area=="21") area="Liaoning";
if(area=="81") area="Hong Kong";
if(area=="31") area="Shanghai";
cout<<"He/She is from "<<area;
cout<<",and his/her birthday is on ";
cout<<month<<","<<day<<","<<year<<" based on the table."<<endl;
}
return 0;
}