#include<stdio.h>
#include<string.h>
int main()
{
    char a[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
    char b[20][9]={"imix","ik","akbal","kan","chicchan","cimi", "manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
    int n,i,j,year[20]={0},day1[20]={0};
    long day[20]={0};
    char m[30][7];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d. %s %d",&day[i],m[i],&year[i]);
    }
    printf("%d\n",n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<19;j++)
        {
            if(strcmp(m[i],a[j])==0)break;
        }
        day[i]+=j*20+year[i]*365+1;
        year[i]=day[i]/260;
        if(day[i]%13==0)day1[i]=13;
        else day1[i]=day[i]%13;    
        if(day[i]%20!=0)
        printf("%d %s %d\n",day1[i],b[day[i]%20-1],year[i]);
        else printf("%d ahau %d\n",day1[i],year[i]);
    }
    return 0;
}
望各位大神指教 running error????
Posted on 2012-07-30 14:59 梁子 阅读(181) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理