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

why wrong answer

Posted by 306565318 at 2008-10-15 19:51:36 on Problem 1008
#include<iostream>
#include<string>
using namespace std;
int main()
{
	int number;
	string haabmouth[19];
	haabmouth[0]="pop";
	haabmouth[1]="no";
	haabmouth[2]="zip";
	haabmouth[3]="zotz";
	haabmouth[4]="tzec";
	haabmouth[5]="xul";
	haabmouth[6]="yoxkin";
	haabmouth[7]="mol";
	haabmouth[8]="chen";
	haabmouth[9]="yax";
	haabmouth[10]="zac";
	haabmouth[11]="ceh";
	haabmouth[12]="mac";
	haabmouth[13]="kankin";
	haabmouth[14]="muan";
	haabmouth[15]="pax";
	haabmouth[16]="koyab";
	haabmouth[17]="cumhu";
	haabmouth[18]="uayet";
	string hollydata[20];
	hollydata[0]="imix";
	hollydata[1]="ik";
	hollydata[2]="akbal";
	hollydata[3]="kan";
	hollydata[4]="chicchan";
	hollydata[5]="cimi";
	hollydata[6]="manik";
	hollydata[7]="lamat";
	hollydata[8]="muluk";
	hollydata[9]="ok";
	hollydata[10]="chuen";
	hollydata[11]="eb";
	hollydata[12]="ben";
	hollydata[13]="ix";
	hollydata[14]="mem";
	hollydata[15]="cib";
	hollydata[16]="caban";
	hollydata[17]="eznab";
	hollydata[18]="canac";
	hollydata[19]="ahau";
	cin>>number;
	int data[200],year[200];
	string mouth[200];
	int n=number,i=0;
	char a;
	while(n)
	{
		cin>>data[i]>>a>>mouth[i]>>year[i];
		if(year[i]>=5000||data[i]<0||year[i]<0)
			continue;
		int k;
		for(k=0;;k++)
		{
			if(mouth[i]==haabmouth[k])
				break;
		}
		int days=data[i]+k*20+year[i]*365;
		year[i]=days/260;
		data[i]=(days%260)%13+1;
		mouth[i]=hollydata[(days%260)%20];
		i++;
		n--;
	}
	i=0;
	cout<<number<<endl;
	while(number)
	{
		cout<<data[i]<<' '<<mouth[i]<<' '<<year[i]<<endl;
		i++;
		number--;
	}
	return 0;
}

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