首页 新闻 搜索 专区 学院

小白求解~poj1008~为何不过

0
[待解决问题]

#include <stdio.h>
#include <string.h>
int main()
{
 int n,a,b,c,i;
 char s[10];
 char y[25][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
 char u[25][20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
 scanf("%d",&n);
 printf("%d\n",n);
 while(n--)
 {
  scanf("%d. %s %d",&a,s,&c);
  {
   a++;
   c*=365;
   for(i=0;i<18;i++)
   {
    if(strcmp(y[i],s)==0)
    {
     b=i;
     break;
    }
   }
   a=20*b+a+c;
  }
  {
   c=(a-1)/260;
   a=a%260;
   b=a%20;
   if(b==0) b=20;
   b--;
   a=a%13;
   if(a==0) a=13;
   printf("%d %s %d\n",a,u[b],c);
  }
 }
 return 0;
}

c
sut_zhuyue的主页 sut_zhuyue | 菜鸟二级 | 园豆:202
提问于:2012-12-08 15:54
< >
分享
所有回答(1)
0

过了

jogger | 园豆:211 (菜鸟二级) | 2013-01-07 11:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册