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 |
哪位牛人帮忙看看?特殊数据没有问题啊,万谢!!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator