题解 | #扑克牌大小#

扑克牌大小

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

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

if len(a[0]) == len(a[1]):

if a[0][0] == "J":
    print(a[0])
elif a[0][0] == "j" and a[1][0] != "J":
    print(a[0])
elif a[0][0] == "A" and a[1][0] != "J" and a[1][0] != "j":
    print(a[0])
elif a[1][0] == "J":
    print(a[1])
elif a[1][0] == "j":
    print(a[1])
elif a[1][0] == "A":
    print(a[1])
elif int(a[0][0]) > int(a[1][0]):
    print(a[0])
elif int(a[0][0]) < int(a[1][0]):
    print(a[1])

else:

if a[0][0] == "J":
    print(a[0])
elif a[0][0] == "j" and a[1][0] != "J":
    print(a[0])
elif a[0][0] == "A" and a[1][0] != "J" and a[1][0] != "j":
    print(a[0])
elif a[1][0] == "J":
    print(a[1])
elif a[1][0] == "j":
    print(a[1])
elif a[1][0] == "A":
    print(a[1])
elif len(a[0]) == 11:
    print(a[0])
elif len(a[0]) == 7 and len(a[1]) != 11:
    print(a[0])
elif len(a[1]) == 11:
    print(a[1])
elif len(a[1]) == 7:
    print(a[1])
elif a[0][-1] == "A":
    print(a[0])
elif a[1][-1] == "A":
    print(a[1])
else:
    print("ERROR")
全部评论

相关推荐

过往烟沉:我说什么来着,java就业面就是广!
点赞 评论 收藏
分享
感性的干饭人在线蹲牛友:🐮 应该是在嘉定这边叭,禾赛大楼挺好看的
点赞 评论 收藏
分享
评论
1
收藏
分享
牛客网
牛客企业服务