# encoding = utf-8
# 开发者:xxx
# 开发时间: 0:44
# "Stay hungry,stay foolish."
def read_time(h, m):
# 英文数字的读法
num_to_word = {
0: "zero", 1: "one", 2: "two", 3: "three", 4: "four", 5: "five",
6: "six", 7: "seven", 8: "eight", 9: "nine", 10: "ten", 11: "eleven",
12: "twelve", 13: "thirteen", 14: "fourteen", 15: "fifteen", 16: "sixteen",
17: "seventeen", 18: "eighteen", 19: "nineteen", 20: "twenty",
30: "thirty", 40: "forty", 50: "fifty"
}
if m == 0:
if h <= 20:
return num_to_word[h] + " o'clock"
if h > 20:
return num_to_word[20] + " " + num_to_word[h - 20] + " o'clock"
elif m <= 20:
if h <= 20:
return num_to_word[h] + " " + num_to_word[m]
if h > 20:
return num_to_word[20] + " " + num_to_word[h - 20] + " " + num_to_word[m]
else:
tens = num_to_word[m // 10 * 10]
ones = num_to_word[m % 10]
if h <= 20:
return num_to_word[h] + " " + tens + " " + ones
if h > 20:
return num_to_word[20] + " " + num_to_word[h - 20] + " " + tens + " " + ones
# 输入当前时间的小时和分钟
h, m = map(int, input().split())
# 输出时间的英文读法
print(read_time(h, m))
01-29
1260
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-27
1224
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)