解题思路:
通过设置小时与分钟输出两函数来实现
注意事项:
注意中英文字符,大于20的数字输出
参考代码:
h,m=[int(i) for i in input().split()]
readline = {'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'}
def clockread(h):
if h<=20:
print(readline[str(h)],end='')
else:
a=readline['20']
h=h-20
print(a,readline[str(h)],end='')
def minread(m):
if m==0:
print("o'clock")
else:
a=m//10
b=m%10
if m<=20:
print(readline[str(m)])
else:
print(readline[str(a)+'0'],readline[str(b)])
clockread(h)
print(' ',end='')
minread(m)
0.0分
1 人评分
简单的a+b (C语言代码)浏览:647 |
C语言程序设计教程(第三版)课后习题9.4 (Java代码)浏览:1419 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:512 |
妹子杀手的故事 (C语言代码)浏览:1233 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:616 |
用筛法求之N内的素数。 (C语言代码)浏览:669 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:562 |
有关字符,字符串的输入输出函数说明浏览:479 |
大家好,我是验题君浏览:577 |
1050题解(结构体数组与结构体指针的使用)浏览:1108 |