题解 | #扑克牌大小#
扑克牌大小
https://www.nowcoder.com/practice/d290db02bacc4c40965ac31d16b1c3eb
s1, s2 = input().strip().split('-') s1 = s1.split() s2 = s2.split() order = ['3','4','5','6','7','8','9','10','J','Q','K','A','2','joker','JOKER'] if len(s1) == len(s2): # 同类型的情况 if order.index(s1[0]) > order.index(s2[0]): print(' '.join(s1)) else: print(' '.join(s2)) else: # 不同类型的情况 if len(s1)==4 or len(s2)==4 or s1==['joker','JOKER'] or s2==['joker','JOKER']: # 合理的比较 if s1==['joker','JOKER'] or s2==['joker','JOKER']: # 有王炸 print(' '.join(['joker','JOKER'])) else: # 无王炸 if len(s1)==4: print(' '.join(s1)) if len(s2)==4: print(' '.join(s2)) else: # 不合理的比较 print('ERROR')