#### 題目描述

5:00 → five o' clock
5:01 → one minute past five
5:10 → ten minutes past five
5:28 → twenty eight minutes past five
5:30 → half past five
5:40 → twenty minutes to six
5:45 → quarter to six
5:47 → thirteen minutes to six

5
47

#### 範例輸出

thirteen minutes to six

#### 參考答案

```import java.util.Scanner;

public class Solution {

private static final String[] NUMBER = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
private static final String[] NUMBER2 = {"twenty", "thirty", "fourty", "fifty"};

private static String numberToString(int n) {
if (n >= 20) {
return String.valueOf(NUMBER2[n / 10 - 2]).concat(" ").concat(NUMBER[n % 10]);
} else {
return String.valueOf(NUMBER[n]);
}
}

public static void main(String[] args) {
final Scanner sc = new Scanner(System.in);
final int H = sc.nextInt(), M = sc.nextInt();

if (M == 0) {
System.out.println(numberToString(H).concat(" o' clock"));
} else if (M == 1) {
System.out.println("one minute past ".concat(numberToString(H)));
} else if (M == 15) {
System.out.println("quarter past ".concat(numberToString(H)));
} else if (M < 30) {
System.out.println(numberToString(M).concat(" minutes past ").concat(numberToString(H)));
} else if (M == 30) {
System.out.println("half past ".concat(numberToString(H)));
} else if (M == 45) {
System.out.println("quarter to ".concat(numberToString(H + 1)));
} else if (M == 59) {
System.out.println("one minute to ".concat(numberToString(H + 1)));
} else {
System.out.println(numberToString(60 - M).concat(" minutes to ").concat(numberToString(H + 1)));
}
}
}```