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:Jakceyl at 2006-05-06 13:20:41 > #include<iostream.h> > #include<string.h> > void main() > { > char*Haab[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen", > "yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; > char* Maya[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok", > "chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; > int n,year,tag=0,sum,day; > char month[9]; > char b; > cin>>n; > int *yearM=new int [n]; > int *dayM=new int [n]; > int *monthM=new int [n]; > for(int i=0;i<n;i++) > { > cin>>day>>b; > cin>>month; > cin>>year; > if(year>=5000||year<0) > return; > while(tag<19) > { > if(strcmp(month,Haab[tag])==0) > break; > tag++; > } > if(year==0) > { > yearM[i]=0; > if(tag<19) > { > sum=tag*20+day+1; > } > else > sum=(tag-1)*20+day+1; > } > else > { > if(tag<19) > { > sum=year*365+tag*20+day+1; > yearM[i]=sum/260; > } > else > { > sum=year*365+(tag-1)*20+day+1; > yearM[i]=sum/260; > } > } > sum=sum%260; > if(sum%13==0) > dayM[i]=13; > else > dayM[i]=(sum)%13; > if(sum%20==0) > monthM[i]=19; > else > monthM[i]=sum%20-1; > tag=0; > } > cout<<n<<endl; > for(int j=0;j<n;j++) > cout<<dayM[j]<<" "<<Maya[monthM[j]]<<" "<<yearM[j]<<endl; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator