| ||||||||||
| 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 | |||||||||
怎么还是wa啊~~~~~~~~天哪#include <stdio.h>
#include<string.h>
int main()
{
int day,year,num,i,j,r,mon=-1,t;
char month2[7];
char month1[][12]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char day2[][11]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
scanf("%d",&num);
printf("%d",&num);
for(i=0;i<num;i++)
{
scanf("%d%*s %s %d",&day,month2,&year);
for(j=0;j<19;j++)
{
if(!strcmp(month2,month1[j]))
break;
}
t=365*year+20*j+day+1;
if(t%260==0)
year=t/260-1;
else
year=t/260;
mon=t%13;
if(!mon)
mon=13;
day=t%20;
if(!day)
day=20;
printf("%d %s %d\n",mon,day2[day-1],year);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator