题解 | #井字棋#

井字棋

https://www.nowcoder.com/practice/0375c1d206ef48a3894f72aa07b2fdde

lines = []
for i in range(3):
    lines.extend(input().split())
n1 = m1 = 0
lx = ['K','K','K']
ly = ['B','B','B']
m = [lines[0:3],lines[3:6],lines[6:9],lines[0::3],lines[1::3],lines[2::3],lines[0::4],lines[2:8:2],-1]
if lx in m:
    print('KiKi wins!')
elif ly in m:
    print('BoBo wins!')
else:
    print('No winner!')

全部评论

相关推荐

深夜书店vv:腾讯是这样的,去年很多走廊都加桌子当工区
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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