Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
用java写的,本地完美运行,提交却是compile error,至今没有一道题提交ac,能帮忙解释下吗?import java.util.*; import java.io.*; public class Main { public static int getnum(String s){ String arr[] ={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin","mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu"}; for(int i=0;i<arr.length;i++) if(arr[i].equals(s))return i+1; return 0; } public static String getmon(int n){ String arr[]={"imix", "ik", "akbal", "kan", "chicchan","cimi", "manik","lamat","muluk","ok","chuen","eb","ben","ix", "mem","cib","caban","eznab","canac","ahau"}; return arr[n-1]; } public static void main(String[] args) throws Exception { Scanner cin = new Scanner(System.in); int max=0; max = cin.nextInt(); System.out.println(max); while(max--!=0){ int day = (int)cin.nextFloat(); String month = cin.next(); int year = cin.nextInt(); int Haab = year*365+(getnum(month)-1)*20+(day+1); int Tzolkin_year = Haab/260; int tmp = Haab%260; if(tmp==0){ System.out.println("13"+" ahau "+(Tzolkin_year-1)); } int Tzolkin_day = tmp%13; if(Tzolkin_day==0) Tzolkin_day=13; int Tzolkin_mon_num = tmp%20; if(Tzolkin_mon_num == 0) Tzolkin_mon_num= 20; String Tzolkin_mon = getmon( Tzolkin_mon_num ); System.out.println(Tzolkin_day+" "+Tzolkin_mon+" "+Tzolkin_year); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator