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

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

Posted by xn823798433 at 2011-07-06 13:11:51 on Problem 1008
In Reply To:我也通过了，但还是WA 啊！！再给几组吧？？？？ Posted by:lengzhigang at 2009-08-20 13:27:06
```> 这组我也通过了，但还是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: