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

怎么老是wrong阿

Posted by first at 2003-11-02 22:34:43 on Problem 1008
#include <iostream> 
#include <string>
using namespace std;
 const string Haab[19]={"pop", "no", "zip", "zotz", "tzec","xul", 
 "yoxkin", "mol", "chen", "yax", "zac", "ceh"
 , "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
const string Tzolkin[20]={"ahau","imix","ik","akbal","kan","chicchan","cimi",
"manik","lamat","muluk","ok","chuen","eb","ben","ix","mem", "cib", "caban", "eznab", "canac"}; 
int main()
{


	int i,j,N,year;
	float day;
    string month;
	long d,totald;
	cin>>N;
	cout<<N<<endl;
	for(i=0;i<N;i++)
	{
		cin>>day>>month>>year;
	    for(j=0;j<19;j++)
		   if(Haab[j]==month)
			   d=j*20+int(day+1.1);
        totald=d+year*365;
		cout<<((totald%13)!=0?(totald%13):13)<<" "<<Tzolkin[totald%20]<<" "<<totald/260<<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