| ||||||||||
| 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 | |||||||||
Re:我觉得我这程序是可以过的,为什么不行呢?In Reply To:我觉得我这程序是可以过的,为什么不行呢? Posted by:zzzzzz at 2004-12-07 09:28:52 > #include<stdio.h>
> #include<string.h>
> void main()
> {
> char *a[]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
> char *b[]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
> char n[10];
> int d,w,y,i,j,k=0,sum,y2,d2,left,e;
> scanf("%d",&e);
>
> for(w=1;w<=e;w++)
> {
> scanf("%d. ",&d);scanf("%s",n);scanf(" %d",&y);
> for(i=0;i<=18;i++)
> if(strcmp(n,*(a+i))==0)break;
> sum=365*y+20*i+d+1;
> y2=sum/260;
> if(sum%260==0)printf("1 imix %d\n",y2);
> else
> {
> left=sum%260;
> {
> j=left%20;
> if(j==0) j=19;
> else j=j-1;
> }
> d2=left%13;
> if(d2==0) d2=13;
> printf("%d %s %d\n",d2,*(b+j),y2);
> }
>
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator