Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:什么是presentation error!

Posted by chengcheng850129 at 2005-06-11 16:44:13 on Problem 1008
我的代码是:比较幼稚,请指教阿!

#include<iostream>
#include<string>
using namespace std;

int main()
{
	int da,ye,number,k(0);
	string mon,datekey,month;
	cin>>number;
	cout<<number;
	while(k<number)
	{
		k++;
		cin>>datekey>>mon>>ye;
		int middle;
		if(mon=="pop")
			middle=0;
		else if(mon=="no")
			middle=1;
		else if(mon=="zip")
			middle=2;
		else if(mon=="zotz")
			middle=3;
		else if(mon=="tzec")
			middle=4;
		else if(mon=="xul")
			middle=5;
		else if(mon=="yoxkin")
			middle=6;
		else if(mon=="mol")
			middle=7;
		else if(mon=="chen")
			middle=8;
		else if(mon=="yax")
			middle=9;
		else if(mon=="zac")
			middle=10;
		else if(mon=="ceh")
			middle=11;
		else if(mon=="mac")
			middle=12;
		else if(mon=="kankin")
			middle=13;
		else if(mon=="muan")
			middle=14;
		else if(mon=="pax")
			middle=15;
		else if(mon=="koyab")
			middle=16;
		else if(mon=="cumhu")
			middle=17;
		else if(mon=="uayet" )
			middle=18;
		if(datekey=="0.")
			da=0;
		if(datekey=="1.")
			da=1;
		if(datekey=="2.")
			da=2;
		if(datekey=="3.")
			da=3;
		if(datekey=="4.")
			da=4;
		if(datekey=="5.")
			da=5;
		if(datekey=="6.")
			da=6;
		if(datekey=="7.")
			da=7;
		if(datekey=="8.")
			da=8;
		if(datekey=="9.")
			da=9;
		if(datekey=="10.")
			da=10;
		if(datekey=="11.")
			da=11;
		if(datekey=="12.")
			da=12;
		if(datekey=="13.")
			da=13;
		if(datekey=="14.")
			da=14;
		if(datekey=="15.")
			da=15;
		if(datekey=="16.")
			da=16;
		if(datekey=="17.")
			da=17;
		if(datekey=="18.")
			da=18;
		if(datekey=="19.")
			da=19;
		int total=ye*365+middle*20+da;
		int year=total/260; //实际的年数:总的天数对360取整
		int leftdate=total-260*year;
		int date=leftdate%13+1; //实际的日期数:总的天数对360取余后,对13取余
		int monthkey=leftdate%20;
		if(monthkey==0)
			month="imix";
		else if(monthkey==1)
			month="ik";
		else if(monthkey==2)
			month="akbal";
		else if(monthkey==3)
			month="kan";
		else if(monthkey==4)
			month="chicchan";
		else if(monthkey==5)
			month="cimi";
		else if(monthkey==6)
			month="manik";
		else if(monthkey==7)
			month="lamat";
		else if(monthkey==8)
			month="muluk";
		else if(monthkey==9)
			month="ok";
		else if(monthkey==10)
			month="chuen";
		else if(monthkey==11)
			month="eb";
		else if(monthkey==12)
			month="ben";
		else if(monthkey==13)
			month="ix";
		else if(monthkey==14)
			month="mem";
		else if(monthkey==15)
			month="cib";
		else if(monthkey==16)
			month="caban";
		else if(monthkey==17)
			month="eznab";
		else if(monthkey==18)
			month="canac";
		else if(monthkey==19)
			month="ahau";
		cout<<date<<" "<<month<<" "<<year<<endl;
	}
	
	
	return 1;
}




Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator