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 2004huangyimin at 2005-06-03 18:38:36 on Problem 1008
#include<iostream>
#include<string>
using namespace std;
void main()
{
	long *day,*year,i,n,j;
	long Ty,Td,Tzd1,Nd(0),Tzd2;
	char p;
	char* Haab[19]= {"pop","no","zip", "zotz", "tzec", "xul", "yoxkin", "mol", 
	                "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", 
					"koyab", "cumhu","uayet"};
    char*Tzolkin[20]= {"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi", 
		"manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", 
		"caban", "eznab", "canac"};
	string *mon;
	cin>>n;
    day=new long[n];
	year=new long[n];
    mon=new string[n];
	for(i=0;i<n;i++)
	{
		cin>>day[i]>>p>>mon[i]>>year[i];
	}
	cout<<n<<endl;

	for(i=0;i<n;i++)
	{
		for(j=0;j<19;j++)
		{ 
			if(mon[i]==Haab[j])
			{Nd=j*20;}
		}
		Nd=Nd+year[i]*365+day[i]+1;
		Ty=(Nd-1)/260;
		Td=(Nd%260);
		Tzd2=Td%20;
        if(Td%13!=0)
		{ Tzd1=Td%13;}
		else{Tzd1=13;}
        cout<<Tzd1<<ends<<Tzolkin[Tzd2]<<ends<<Ty<<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