#include<iostream>
#include<map>
using namespace std;
map<string,int> StrToInt;
map<int,string> IntToStr;
string low[13]={"tret","jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"};
string high[13]={"tret","tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"};
void init()
{
for(int i=0;i<13;i++){
IntToStr[i]=low[i];
StrToInt[low[i]]=i;
IntToStr[i*13]=high[i];
StrToInt[high[i]]=i*13;
}
for(int i=1;i<13;i++){
for(int j=1;j<13;j++){
IntToStr[i*13+j]=high[i]+" "+low[j];
StrToInt[high[i]+" "+low[j]]=i*13+j;
}
}
}
int main()
{
init();
int n;
string str;
scanf("%d",&n);
getchar();
for(int i=0;i<n;i++){
getline(cin,str);
if(str[0]>='0'&&str[0]<='9'){
int ans=0;
sscanf(str.c_str(),"%d",&ans);
cout<<IntToStr[ans]<<endl;
}else{
cout<<StrToInt[str]<<endl;
}
}
return 0;
}
PAT A 1100 Mars Numbers
最新推荐文章于 2022-09-13 23:30:00 发布