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 00448216 at 2005-03-05 21:15:31 on Problem 1008
#include<iostream>
#include<string.h>
using namespace std;
int t,i,j,date,year,m;
long int sum;
char month[10],u[2],a[20][9]={ "ahau","imix","ik","akbal","kan","chicchan",
						"cimi","manik","lamat","muluk","ok",
						"chuen","eb","ben","ix","mem","cib",
						"caban","eznab","canac" };
char b[18][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
void main()
{
	cin>>t;
	cout<<t<<endl;
	for(i=0;i<t;i++)
	{
		cin>>date>>u>>month>>year;
		for(j=0;j<18;j++)
			if(strcmp(month,b[j])==0)
				m=j;
		sum=year*365+m*20+date;
		year=sum/260;
		sum%=260;
		date=sum%13+1;
		sum=(sum+1)%20;
		cout<<date<<" "<<a[sum]<<" "<<year<<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