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

特殊数据我通过了,怎么还是WA啊,大神们帮忙看看啊~~~

Posted by Dongdongdu at 2011-05-26 10:25:08 on Problem 1008
In Reply To:注意这组数据 Posted by:bergkamp at 2006-08-04 20:38:33
#include <iostream>
using namespace std;
int main()
{
	int j,k,n,tian,nian,month,s,biaozhi;
	float temp;
	char dian,day[10],yue[10],Haab[20][10]={"a","pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"},
		Tzolkin[20][10]={"ahau","imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac"};
	cin>>n;
	cout<<n<<endl;
	while(n--)
	{
		cin>>temp>>yue>>nian;
		tian=(int)(temp);
		for(j=1;j<=19;j++)
		{
			k=0;
			biaozhi=0;
			while(yue[k]||Haab[j][k])
			{
				if(yue[k]!=Haab[j][k])
				{
					biaozhi=1;
					break;
				}
				k++;
			}
			if(biaozhi==0)
				break;
		}
		s=nian*365+(j-1)*20+tian+1;
		if(s%365==0&&s%260==0)
			nian=s/260-1;
		else
	    	nian=s/260;
		if(s%13==0)
			month=13;
		else
	    	month=s%13;
	    tian=s%20;
		j=0;
		while(Tzolkin[tian][j])
		{
			day[j]=Tzolkin[tian][j];
			j++;
		}
		day[j]='\0';
		cout<<month<<" "<<day<<" "<<nian<<endl;
	}
	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