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

麻烦帮我看下到底错哪儿了~谢了!快疯掉了!

Posted by 0761 at 2005-03-06 01:52:40 on Problem 1008


#include<iostream.h>
#include<string.h>

void main()
{
	char haab[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
		 "zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char tzolkin[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat",
		"muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	int t,i,j,year1,day1,num,year2;
	long int days;
	char month[7];
	cin>>t;
	cout<<t<<endl;
	for(i=1;i<=t;i++){
		cin>>day1>>month;
		do{
			cin>>year1;
		}while(year1>=5000);
		if(!strcmp(month,haab[18])){
			days=365*year1+20*18+day1+1;
		}
		else{
			for(j=0;j<18;j++)
				if(!strcmp(month,haab[j]))
					days=365*year1+20*j+day1+1;
		}
		year2=days/260;
		num=days%13;
		int k=days%20;
		if(k!=0)
			cout<<num<<" "<<tzolkin[k-1]<<" "<<year2<<endl;
		else
			cout<<num<<" "<<tzolkin[19]<<" "<<year2<<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