import java.io.*;
public class Main{
public static void main
(String[] args
) { testcases();
}
public static void converttime(int hours, int minutes) {
String[] singles
= {"twelve ",
"one ",
"two ",
"three ",
"four ",
"five " ,
"six ",
"seven ",
"eight ",
"nine ",
"ten ",
"eleven ",
"twelve ",
"thirteen ",
"fourteen ",
"fifteen ",
"sixteen ",
"seventeen ",
"eighteen ",
"nineteen "}; String[] tens
= {"",
"oh " ,
"twenty ",
"thirty ",
"fourty ",
"fifty "}; int t_tens = ((minutes +9 )/10);
String min_rdigit
= (minutes
% 10 == 0 && minutes
!= 10 ) ? "" : singles
[minutes
%20
]; String min_ldigit
= (t_tens
== 1 ) ? tens
[t_tens
] : tens
[(minutes
/10)]; String am_pm
= (hours
> 12) ? "pm" : "am";
System.
out.
println("It's " + singles
[(hours
% 12)] + min_ldigit
+ min_rdigit
+ am_pm
);
}
public static void testcases() {
String [] test_values
= { "00:00",
"01:30",
"12:05",
"14:01",
"20:29",
"21:00"}; for(String value
: test_values
) { String[] time
= value.
split(":"); int i_hour
= Integer.
parseInt(time
[0]); int i_minute
= Integer.
parseInt(time
[1]); converttime(i_hour, i_minute);
}
}
}
aW1wb3J0IGphdmEuaW8uKjsKCnB1YmxpYyBjbGFzcyBNYWluewoKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQl0ZXN0Y2FzZXMoKTsKCX0KCQoJcHVibGljIHN0YXRpYyB2b2lkIGNvbnZlcnR0aW1lKGludCBob3VycywgaW50IG1pbnV0ZXMpIHsKCQlTdHJpbmdbXSBzaW5nbGVzID0geyJ0d2VsdmUgIiwgIm9uZSAiLCAidHdvICIsICJ0aHJlZSAiLCAiZm91ciAiLCAiZml2ZSAiICwgInNpeCAiLCAic2V2ZW4gIiwgImVpZ2h0ICIsICJuaW5lICIsICJ0ZW4gIiwgImVsZXZlbiAiLCAidHdlbHZlICIsICJ0aGlydGVlbiAiLCAiZm91cnRlZW4gIiwgImZpZnRlZW4gIiwgInNpeH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