题解 | #扑克牌大小#
扑克牌大小
https://www.nowcoder.com/practice/d290db02bacc4c40965ac31d16b1c3eb
dic = {'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': 12, 'joker': 13, 'JOKER': 14} def isJk(s): s = ' '.join(s) if s == 'joker JOKER': return True def isboom(s): if len(set(s)) == 1 and len(s) == 4: return True tmp = input().strip().split('-') l = tmp[0].split() r = tmp[1].split() if len(l) == len(r): if dic[l[0]] <= dic[r[0]]: print(' '.join(r)) else: print(' '.join(l)) elif isJk(l): print(' '.join(l)) elif isJk(r): print(' '.join(r)) elif isboom(l) and isboom(r): if dic[l[0]] < dic[r[0]]: print(r) elif isboom(l): print(' '.join(l)) elif isboom(r): print(' '.join(r)) else: print('ERROR')