题解 | #扑克牌大小#字典比较法
扑克牌大小
http://www.nowcoder.com/practice/d290db02bacc4c40965ac31d16b1c3eb
while True: try: s1,s2 = input().split("-") lst1,lst2 = s1.split(),s2.split() poker = {"3":1, "4":2, "5":3, "6":4, "7":5, "8":6, "9":7, "10":8, "J":9, "Q":10, "K":11, "A":12, "2":13, "joker":14, "JOKER":15} if len(lst1)==len(lst2): if poker[lst1[0]] > poker[lst2[0]] : print(s1) else: print(s2) else: if "joker JOKER" in (s1,s2): print("joker JOKER") elif len(lst1)==4: print(s1) elif len(lst2)==4: print(s2) else: print("ERROR") except: break