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 2011014326 at 2012-09-19 22:32:35 on Problem 1008
#include<iostream>
#include<string.h>
using namespace std;

typedef struct Time
{
	int day;
	char c;
	char month[22];
	int year;
}time;

int main()
{
	char month1[22][22]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
                         "zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};

	char month2[22][23]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk",
                         "ok","chuen","eb", "ben","ix","mem","cib","caban","eznab","canac","ahau"};

	time T1,T2;
	int temp;
	int i,j,n;
	cin>>n;
	cout<<n<<endl;

	for(i=0;i<n;i++)
	{
		cin>>T1.day>>T1.c>>T1.month>>T1.year;

		for(j=0;j<19;j++)
		{
			if(strcmp(T1.month,month1[j])==0)
				break;
		}
        
		T2.year=((T1.year)*365+j*20+T1.day+1)/260;
        temp=((T1.year)*365+j*20+T1.day+1)%260%20;
		strcpy(T2.month,month2[temp-1]);
		T2.day=(((T1.year)*365+j*20+T1.day+1)%260)%13;

		if(((T1.year)*365+j*20+T1.day+1)%260==0)
		{
			T2.year--;
			strcpy(T2.month,"ahau");
			T2.day=13;
		}

		cout<<T2.day<<" "<<T2.month<<" "<<T2.year<<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