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 |
请各位武功盖世的英雄豪杰帮助一下我这个无名小卒为什么我的这个程序总是错! #include <stdio.h> #include <string.h> const char a[19][7]={ "pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; const char b[20][9]={ "imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int main() { int n,i,j,k,day,year; long sum; char d[7]={0}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d. %s %d",&day,d,&year); if(i==0) printf("%d\n",n); for(j=0;j<19;j++) { if(strcmp(a[j],d)==0) { k=j; break; } } sum=(long)year*365+(long)day+(long)k*20+1; year=sum/260; k=sum-260*(long)year; day=k%13; if(day==0) day=13; k=k%20; if(k==0) k=20; printf("%d %s %d\n",day,b[k-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