题解 | #扑克牌大小#

扑克牌大小

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

card = input().split("-")

left_s = card[0]
right_s = card[1]

left = card[0].split()
right = card[1].split()

order = ["3","4","5","6","7","8","9","10","J","Q","K","A","2","joker","JOKER"]


if left == ["joker","JOKER"] or right == ["joker","JOKER"]:
    print("joker JOKER")
elif len(left) == 4 and len(right) != 4:
    print(left_s)

elif len(left) != 4 and len(right) == 4:
    print(right_s)

elif len(left)==len(right):
    if order.index(left[0]) > order.index(right[0]):
        print(left_s)
    else:
        print(right_s)
else:
    print("ERROR")

全部评论

相关推荐

11-09 01:22
已编辑
东南大学 Java
高级特工穿山甲:羡慕,我秋招有家企业在茶馆组织线下面试,约我过去“喝茶详谈”😢结果我去了发现原来是人家喝茶我看着
点赞 评论 收藏
分享
找不到工作死了算了:没事的,雨英,hr肯主动告知结果已经超越大部分hr了
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务