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 |
我的结果没错啊,为什么是PE呢??哪位给看看怎么回事?!涉及输出的地方已注释标出!#include<stdio.h> #include<string.h> void main() { int dom[19] = {20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,5}; char hname[][10]= {"pop", "no", "zip","zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; int n,d,m,y,i,sum; char c,hmonth[10],tname[][10] = {"imix", "ik", "akbal", "kan", "chicchan", "cimi","manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem"," cib", "caban", "eznab", "canac", "ahau"}; scanf("%d",&n); printf("%d\n",n);//输出n!!!!!!!!!!!! while( n-- > 0) { d = 0;i = 0; c = getchar(); while((c = getchar())!='.') { d = d*10 + c - '0'; } c = getchar(); while((c = getchar())!=' ') { hmonth[i++]=c; } hmonth[i]='\0'; i = 0; while(i<19) { if(!strcmp(hmonth,hname[i])) { m = i;break; } i++; } scanf("%d",&y); sum = 365 * y; for(i =0;i< m;i++) sum += dom[i]; sum = sum + d + 1 ; y = 0; while(sum - y*260 > 260) y ++; d = sum; while(d - 13 > 0) d -= 13; m = (sum-1)%20; printf("%d %s %d\n",d,tname[m],y);//输出!!!!!! } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator