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 424424 at 2008-08-06 21:43:51 on Problem 1008
import java.util.*;
class Main{
	static String[] haab = {"pop", "no", "zip", "zotz", "tzec",
			 "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", 
			 "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
	static String[] tzolkin = {"imix", "ik",  "akbal", "kan", "chicchan", "cimi", "manik", "lamat", 
			"muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	public static void main(String[] args){
		
	
		Scanner cin = new Scanner(System.in);
		
		int times = cin.nextInt();
	
		for(int i=0; i<times; i++){
			String sday,smonth,syear;
			int day=0;
			sday = cin.next();
			int c = sday.indexOf(".");
			sday = sday.substring(0,c);

			day = Integer.parseInt(sday);
			
			smonth = cin.next();
			for(int j=0; j<20;j++)
				if(smonth.equals(haab[j])){
					day = day + j*20;
					break;
				}
			syear = cin.next();
			int sy = Integer.parseInt(syear);

			day = day + 365*sy;
			
			int year = day/260;
			
			int d = day%13 + 1;
				
			System.out.println(d + " " + tzolkin[day%20] + " " + year);
		}

	}
}

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