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 |
请教高手,为什么老是WA#include<iostream> #include<string.h> using namespace std; int t,i,j,date,year,m; long int sum; char month[10],u[2],a[20][9]={ "ahau","imix","ik","akbal","kan","chicchan", "cimi","manik","lamat","muluk","ok", "chuen","eb","ben","ix","mem","cib", "caban","eznab","canac" }; char b[18][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"}; void main() { cin>>t; cout<<t<<endl; for(i=0;i<t;i++) { cin>>date>>u>>month>>year; for(j=0;j<18;j++) if(strcmp(month,b[j])==0) m=j; sum=year*365+m*20+date; year=sum/260; sum%=260; date=sum%13+1; sum=(sum+1)%20; cout<<date<<" "<<a[sum]<<" "<<year<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator