Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 我也通过了，但还是WA 啊！！再给几组吧？？？？

Posted by lengzhigang at 2009-08-20 13:27:06 on Problem 1008
In Reply To:Re:也通过了，但还是WA 啊！！再给几组吧？？？？ Posted by:qichao at 2009-07-24 12:00:34
```这组我也通过了，但还是WA，请高手帮忙啊

#include<stdio.h>
#include<string.h>

void tran(int Hday,char *q,int Hyear)
{
int i=0,yu,Ti,Tyear,Tday;
long int allday;
char *mon[20]= {"imix","ik","akbal","kan","chichan","cimi","manik",
"lamat","mulak","ok","chuen","eb","ben","ix","mem","cib","caban",
"eznab","canac","ahau"};
char *m[19]={"pop","no","zip","zotz","tzec", "xul","yoxkin","mol","chen","yax","zac",
"ceh","mac","kankin","muan","pax","koyab","cumhu", "uayet"};

while(strcmp(m[i],q)!=0)
i++;
allday=Hyear*365+i*20+Hday+1;
Tyear=allday/260;
if(allday%20==0) Tyear=Tyear-1;
else   yu=allday%260;
if(yu%13==0) Tday=13;
else Tday=yu%13;
if(yu%20==0) Ti=20;
else  Ti=yu%20;
printf("%d %s %d\n",Tday,mon[Ti-1],Tyear);

}

int main()
{
int a, b, Hday, Hyear;
char p[20];
scanf("%d",&b);
printf("%d\n",b);
for(a=0;a<b;a++)
{  scanf("%d.%s%d",&Hday,p,&Hyear);
tran(Hday,p,Hyear);

}
return 0;
}```

Followed by: