Brian Warehouse

Some birds aren`t meant to be caged, their feathers are just too bright... ...
posts - 40, comments - 16, trackbacks - 0, articles - 1

POJ 1008 Maya Calendar

Posted on 2010-08-17 14:16 Brian 阅读(337) 评论(0)  编辑 收藏 引用 所属分类: POJ
思路:先求第一个的天数,然后用这个天数求第二个的表示方式,个人觉得不是水题
#include<stdio.h>
#include
<string.h>
char hm[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
                
"zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char tm[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok",
                
"chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
int main()
{
    
int i,m,n,day,year;
    
char month[9];    
    scanf(
"%d",&n);
    printf(
"%d\n",n);
    
    
while (n--)
    {
        scanf(
"%d.%s%d",&day,month,&year);
        
for(i=0; i<19; i++)
            
if(strcmp(hm[i],month) == 0)
            {
                m
=365*year+20*i+day;
                
break;
            }
        printf(
"%d %s %d\n",m%260%13+1,tm[m%20],m/260);
    }
    
return 0;
}

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