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:实在想不通为什么是wrong answer

Posted by 123345 at 2004-01-10 14:54:34 on Problem 1008
In Reply To:实在想不通为什么是wrong answer Posted by:123345 at 2004-01-09 12:58:43
> #include<iostream>
> #include<string>
> 
> struct calenday
> {
> 	int day;
> 	std::string mouth;
> 	int mou;
> 	int year;
> };
> 
> void main()
> {
> 	int n;
> 	std::cin>>n;
> 	calenday * haab;
> 	calenday * holly;
> 	haab=new calenday[n];
> 	holly=new calenday[n];
> 	char doc;
> 	for(int i=0;i<n;i++)
> 	{
>     	std::cin>>haab[i].day ;
> 		std::cin>>doc;
> 		std::cin>>haab[i].mouth ;
> 		std::cin>>haab[i].year ;
> 	}
> 	int totalday;
> 	for( i=0;i<n;i++)
> 	{
> 		if(haab[i].mouth=="pop")	{haab[i].mou =0;}
> 		if(haab[i].mouth=="no")	    {haab[i].mou =1;}
> 		if(haab[i].mouth=="zip")	{haab[i].mou =2;}
> 		if(haab[i].mouth=="zotz")	{haab[i].mou =3;}
> 		if(haab[i].mouth=="tzec")	{haab[i].mou =4;}
> 		if(haab[i].mouth=="xul")	{haab[i].mou =5;}
> 		if(haab[i].mouth=="yoxkin")	{haab[i].mou =6;}
> 		if(haab[i].mouth=="mol")	{haab[i].mou =7;}
> 		if(haab[i].mouth=="chen")	{haab[i].mou =8;}
> 		if(haab[i].mouth=="yax")	{haab[i].mou =9;}
> 		if(haab[i].mouth=="zac")	{haab[i].mou =10;}
> 		if(haab[i].mouth=="ceh")	{haab[i].mou =11;}
> 		if(haab[i].mouth=="mac")	{haab[i].mou =12;}
> 		if(haab[i].mouth=="ankin")	{haab[i].mou =13;}
> 		if(haab[i].mouth=="muan")	{haab[i].mou =14;}
> 		if(haab[i].mouth=="pax")	{haab[i].mou =15;}
> 		if(haab[i].mouth=="koyab")	{haab[i].mou =16;}
> 		if(haab[i].mouth=="cumhu")	{haab[i].mou =17;}
> 		if(haab[i].mouth=="uayet")	{haab[i].mou =18;}
> 
> 
> 		totalday=haab[i].day+1 +haab[i].mou *20+haab[i].year *365;
> 		if(totalday%260==0)
> 		holly[i].year =totalday/260-1;
> 		else
>         holly[i].year =totalday/260;
>         if((totalday%260)%13==0)
> 			holly[i].day =13;
> 		else
> 		    holly[i].day =(totalday%260)%13;
> 		if((totalday%260)%20==0)
> 			holly[i].mou =20;
> 		else
> 	    	holly[i].mou =(totalday%260)%20;
> 		switch(holly[i].mou )
> 		{
> 		case 1:
> 			holly[i].mouth ="imix";
> 			break;
> 		case 2:
> 			holly[i].mouth ="ik";
> 			break;
> 		case 3:
> 			holly[i].mouth ="akbal";
> 			break;
> 		case 4:
> 			holly[i].mouth ="kan";
> 			break;
> 		case 5:
> 			holly[i].mouth ="chicchan";
> 			break;
> 		case 6:
> 			holly[i].mouth ="cimi";
> 			break;
> 		case 7:
> 			holly[i].mouth ="manik";
> 			break;
> 		case 8:
> 			holly[i].mouth ="lamat";
> 			break;
> 		case 9:
> 			holly[i].mouth ="mmuluk";
> 			break;
> 		case 10:
> 			holly[i].mouth ="ok";
> 			break;
> 		case 11:
> 			holly[i].mouth ="chuen";
> 			break;
> 		case 12:
> 			holly[i].mouth ="eb";
> 			break;
> 		case 13:
> 			holly[i].mouth ="ben";
> 			break;
> 		case 14:
> 			holly[i].mouth ="ix";
> 			break;
> 		case 15:
> 			holly[i].mouth ="mem";
> 			break;
> 		case 16:
> 			holly[i].mouth ="cib";
> 			break;
> 		case 17:
> 			holly[i].mouth ="caban";
> 			break;
> 		case 18:
> 			holly[i].mouth ="eznab";
> 			break;
> 		case 19:
> 			holly[i].mouth ="canac";
> 			break;
> 		case 20:
> 			holly[i].mouth ="ahau";
> 			break;
> 		}
> 	}
> 	std::cout<<n<<std::endl;
> 	for(i=0;i<n;i++)
> 	{
> 		std::cout<<holly[i].day <<" "<<holly[i].mouth <<" "<<holly[i].year<<std::endl ;
> 	}
> }
> 

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