import random
n=0
m=0
q=0
print("欢迎来到拳王争霸赛现场,有请选手登场")
while n<=2:
n+=1
print(end='\n')
print("第%d轮请出"%(n), end='')
guess = int(input(":"))
ran = random.randint(0, 2)
if guess == 0:
if ran == 1:
print("你是剪刀,对方是石头。你输了!")
q += 1
elif ran==0:
print("你是剪刀,对方也是剪刀,平局!")
elif ran == 2:
print("你是剪刀,对方是步,你赢了!")
m+=1
elif guess == 1:
if ran == 1:
print("你是石头,对方是石头。平局!")
elif ran == 0:
print("你是石头,对方也是剪刀,恭喜你赢了!")
m+=1
elif ran == 2:
print("你是石头,对方是步,你输了!")
q += 1
elif guess == 2:
if ran == 1:
print("你是步,对方是石头。你赢了!")
m+=1
elif ran == 0:
print("你是步,对方也是剪刀,你输了")
q += 1
elif ran == 2:
print("你是步,对方是步,平局哎")
else:
print("出错了,只能出石头剪刀步哦!")
break
print(end='\n')
print(end='\n')
print("你赢了%d局,对方赢了%d局"%(m,q))
if m>q:
print("哇哦,今晚的拳王就是你!")
elif m == q:
print("打平手了哎")
else:
print("对方才是拳王")