Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register
ACM ICPC 2018 World Finals

## Java写的，case 都过了一直WA，求大神帮帮忙！（大家讨论的很强case也能过）

Posted by bbbqse at 2017-12-06 13:57:52 on Problem 1008
```import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

public 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", "men", "cib", "caban", "eznab", "canac", "ahau" };

public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
System.setIn(new FileInputStream("input.txt"));
Scanner scan = new Scanner(System.in);

int N = scan.nextInt();
System.out.println(N);

for (int i = 0; i < N; i++) {
String s = scan.next().replace(".", "");
int data = Integer.parseInt(s);
String month = scan.next();
int year = scan.nextInt();

int sum = haab(data, month, year);

toTzolkim(sum);

}
}

private static void toTzolkim(int sum) {
// TODO Auto-generated method stub
int year = sum / 260;
int m = sum % 20;
String month = Tzolkin[m];
int day = sum % 13 + 1;

System.out.println(day + " " + month + " " + year);

}

private static int haab(int data, String month, int year) {
// TODO Auto-generated method stub
int m = 0;
for (int i = 0; i < 19; i++) {
if (month.equals(haab[i])) {
m = 20 * i;
}
}

return data + m + 365 * year;
}
}  ```

Followed by: