1100 Mars Numbers(20 分)

打表

#include
using namespace std;
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"};
mapstrtoint;
mapinttostr;
int n;
void init()
{
    for(int i=0;i<13;i++)strtoint[low[i]]=i,inttostr[i]=low[i];
    for(int i=1;i<13;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++)
        {
            int num=i*13+j;
            string s=high[i]+" "+low[j];
            strtoint[s]=num;
            inttostr[num]=s;
        }
    }
}
int main()
{
    init();
    int n; 
    scanf("%d",&n);
    getchar();
    while(n--)
    {
        string s;
        getline(cin,s);
        if(s[0]>='0'&&s[0]<='9')
        {
            int num=0;
            for(int i=0;i

你可能感兴趣的:(1100 Mars Numbers(20 分))