Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
伟大的系统,错误怎么都找不到#include"stdio.h" #include"string.h" void main() { int i, j, n, year1, year2, day1=0, day2=0, month1, month2, days1, days2,days; char a[10000]={'\0'}, ch,b[10000]={'\0'}; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d.",&day1); ch=getchar(); scanf("%s",b); scanf("%d",&year1); if(strcmp(b,"uayet")==0) day1+=360; else if (strcmp(b,"cumhu")==0) day1+=340; else if (strcmp(b,"koyab")==0) day1+=320; else if (strcmp(b,"pax")==0) day1+=300; else if (strcmp(b,"muan")==0) day1+=280; else if (strcmp(b,"kankin")==0) day1+=260; else if (strcmp(b,"mac")==0) day1+=240; else if (strcmp(b,"ceh")==0) day1+=220; else if (strcmp(b,"zac")==0) day1+=200; else if (strcmp(b,"yax")==0) day1+=180; else if (strcmp(b,"chen")==0) day1+=160; else if (strcmp(b,"mol")==0) day1+=140; else if (strcmp(b,"yoxkin")==0) day1+=120; else if (strcmp(b,"xul")==0) day1+=100; else if (strcmp(b,"tzec")==0) day1+=80; else if (strcmp(b,"zotz")==0) day1+=60; else if (strcmp(b,"zip")==0) day1+=40; else if (strcmp(b,"no")==0) day1+=20; else if (strcmp(b,"pop")==0) day1+=0; days1=(year1*365+day1); year2=days1/260; days2=days1%260; month1=days2%13+1; month2=days2%20+1; switch(month2) { case 1 : strcpy(a,"imix");break; case 2 : strcpy(a,"ik");break; case 3 : strcpy(a,"akbal");break; case 4 : strcpy(a,"kan");break; case 5 : strcpy(a,"chicchan");break; case 6 : strcpy(a,"cimi");break; case 7 : strcpy(a,"manik");break; case 8 : strcpy(a,"lamat");break; case 9 : strcpy(a,"muluk");break; case 10 : strcpy(a,"ok");break; case 11 : strcpy(a,"chuen");break; case 12 : strcpy(a,"eb");break; case 13 : strcpy(a,"ben");break; case 14 : strcpy(a,"ix");break; case 15 : strcpy(a,"mem");break; case 16 : strcpy(a,"cib");break; case 17 : strcpy(a,"caban");break; case 18 : strcpy(a,"eznab");break; case 19 : strcpy(a,"canac");break; case 20 : strcpy(a,"ahau");break; } printf("%d %s %d\n",month1,a,year2); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator