#include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int shuzi = 0;
int flag;
string di[13] = {"tret","jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"};
string jin[13] = {"0","tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"};
string str;
cin>>n;
getchar();
while(n--){
shuzi = 0;
getline(cin,str);
if(str[0] <= '9' && str[0] >= '0'){//ÈôΪÊý×Ö
for(int i = 0;i < str.length() ; i++){
shuzi = shuzi * 10 + str[i] - '0';
}
if(shuzi <= 12){
cout<<di[shuzi]<<endl;
}else{
if(shuzi % 13 == 0){
cout<<jin[shuzi / 13]<<endl;
}else{
cout<<jin[shuzi / 13]<<" "<<di[shuzi % 13]<<endl;
}
}
}else{//ÈôΪ»ðÐÇÎÄ
string temp = "";
for(int i = 0; i < str.length(); i += 4){
temp = temp + str[i] + str[i + 1] + str[i + 2];
for(int i = 0; i < 13; i++){
if(di[i] == temp){
shuzi = shuzi + i;
}
if(jin[i] == temp){
shuzi = shuzi + i * 13;
}
}
temp = "";
}
cout<<shuzi<<endl;
}
}
return 0;
}
【PAT】1044火星文字
最新推荐文章于 2022-09-12 20:16:28 发布