题解 | #定制显示器#

定制显示器

https://www.nowcoder.com/practice/b0a788bcb021425f9391067fd2646b07

name = input()
age = int(input())
if age%10==1 and age%100 != 11:
    print('Happy {}st birthday to {}!'.format(age,name))
elif age%10==2 and age%100 != 12:
    print('Happy {}nd birthday to {}!'.format(age,name))    
elif age%10==3 and age%100 != 13:
    print('Happy {}rd birthday to {}!'.format(age,name)) 
else:
    print('Happy {}th birthday to {}!'.format(age,name))

全部评论
这个题目没这么复杂吧
点赞 回复 分享
发布于 2024-12-12 12:17 宁夏
想的很周到呀
点赞 回复 分享
发布于 2024-06-06 18:35 美国
想多了兄弟们,没那么复杂
点赞 回复 分享
发布于 2023-09-12 17:49 四川
???
点赞 回复 分享
发布于 2023-02-21 10:46 山东

相关推荐

2025-12-11 14:24
门头沟学院 Java
在debug的伊泽瑞...:我说怎么这么眼熟查看图片
点赞 评论 收藏
分享
抓蛙得要春天:别想那么多,找得到再说,有面试再说
点赞 评论 收藏
分享
评论
4
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务