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 |
好,贴出来了,大哥给俺看看吧In Reply To:贴出来,帮你看,谁有时间做数据? Posted by:sunmoonstar_love at 2005-08-08 18:08:33 #include<iostream> #include<string> using namespace std; int main() { char hmon[10],tmon[10]; char *mm[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax", "zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; char *nn[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok", "chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int hyear,tyear,test; int hday,tday; long total; int i,tmpmon; while(cin>>test) { cout<<test<<endl; for(i=0;i<test;i++) { scanf("%d. %s %d",&hday,&hmon,&hyear); for(int j=0;j<20;j++) if(strcmp(hmon,mm[j])==0) break; if(hyear%400==0||(hyear%4==0&&hyear%100!=0)) total=hyear*366+20*j+hday; else total=hyear*365+20*j+hday; tyear=total/260; tday=total%13+1; tmpmon=total%20; strcpy(tmon,nn[tmpmon]); printf("%d %s %d\n",tday,tmon,tyear); } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator