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 00448258 at 2005-03-04 20:23:39 on Problem 1008
#include<iostream.h>
#include<string.h>
void main()
{
	int n;
	cin>>n;
	cout<<n<<endl;
	char *m[19]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};
	char *mon[20]={ "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; 
	int M[19];
	for(int i=0;i<19;i++)
	{M[i]=20*i;}

	while(n)
	{
		n--;
		float dayOfH;
		int yearOfH,dayOfT,yearOfT,month;
		char monthOfH[6],monthOfT[6];
		cin>>dayOfH>>monthOfH>>yearOfH;
		(int)dayOfH;
		int num=0;
		for(int i=0;i<19;i++)
			{if(strcmp(m[i],monthOfH)==0)
			  num=i;}
		int sum=yearOfH*365+M[num]+dayOfH+1;

		yearOfT=sum/260;
		if(sum%260%20==0)
			strcpy(monthOfT,"ahau");
		else
		{
			month=sum%260%20-1;
			strcpy(monthOfT,mon[month]);
		}
		dayOfT=sum%260%13;
		cout<<dayOfT<<" "<<monthOfT<<" "<<yearOfT<<" "<<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