题解 | #扑克牌大小#

扑克牌大小

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

A,B = input().strip().split('-')
a = A.split(' ')
b = B.split(' ')
dic = dict()
arr = '3 4 5 6 7 8 9 10 J Q K A 2 joker JOKER'.split(' ')
for i in range(len(arr)):
    dic[arr[i]] = i

if 'joker' in a and 'JOKER' in a:
    print(' '.join(a))
elif 'joker' in b and 'JOKER' in b:
    print(' '.join(b))
elif len(a) == 4 and len(b) == 4:
    if dic.get(a[0]) > dic.get(b[0]):
        print(' '.join(a))
    else:
        print(' '.join(b))
elif len(a) == 4 and len(b) != 4:
    print(' '.join(a))
    
elif len(a) != 4 and len(b) == 4:
    print(' '.join(b))
elif len(a) != len(b):
    print('ERROR')
elif dic.get(a[0]) > dic.get(b[0]):
    print(' '.join(a))
else:
    print(' '.join(b))
        
        

全部评论

相关推荐

06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务