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

这SB的系统,我如果错了我吃马桶!!!!!(代码如下)

Posted by magineq at 2008-08-06 19:52:04 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();
			
			
			syear = cin.next();
			int sy = Integer.parseInt(syear);

			int sum = day + renum(smonth)*20 + sy*365;
				
			System.out.println((1+sum%13) + " " + tzolkin[sum%20] + " " + sum/260);
		}
	}
	
	public static int renum(String s){
		int j;
		for( j=0; j<20; j++)
			if(s.equals(haab[j]))
				break;
		return j;
	}
}

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