题解 | #扑克牌大小#

扑克牌大小

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

while True:
    try:
        s1,s2 = input().split('-')
        a1 = s1.split()
        a2 = s2.split()
        d = {'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,'10':10,'J':11,
            'Q':12,'K':13,'A':14,'2':15,'joker':16,'JOKER':17}
        n1 = len(a1)
        n2 = len(a2)
        if s1 =="joker JOKER" or s2 == "joker JOKER":
            print("joker JOKER")
            break
        if n1==n2:
            if d[a1[0]]>d[a2[0]]:
                print(" ".join(a1))
            else:
                print(" ".join(a2))
        elif n1==4:
            print(" ".join(a1))
        elif n2 == 4:
            print(" ".join(a2))
        else:
            print("ERROR")
    except:
        break
        
       
            
全部评论

相关推荐

点赞 评论 收藏
分享
努力成为C语言高手:质疑大祥老师,理解大祥老师,成为大祥老师
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务