Commit 988d0067 by BellCodeEditor

save project

parent b2294df3
Showing with 21 additions and 16 deletions
# 玩家出拳
a=input("你出什么?(石头/剪刀/布)")
print("玩家出拳:"+a)
import ramdom
list=["剪刀","石头","布"]
b=ramdom.choice(list)
print("机器出拳"+b)
if a in list:
if a==b:
print("平局")
elif (a=="布" and b=="石头") or (a=="石头" and b=="剪刀") or (a=="剪刀" and b=="布"):
print("赢了")
import random
c=0
for i in range(5):
a=input("你出什么?(石头/剪刀/布)")
print("玩家出拳:"+a)
list=["剪刀","石头","布"]
b=random.choice(list)
print("机器出拳"+b)
if a in list:
if a==b:
print("平局")
elif (a=="布" and b=="石头") or (a=="石头" and b=="剪刀") or (a=="剪刀" and b=="布"):
print("赢了")
c+=1
else:
print("输了")
else:
print("输了")
else:
print("输错了")
\ No newline at end of file
print("输错了")
print("你赢了"+str(c)+"次")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment