Commit 2c2db7b7 by BellCodeEditor

save project

parent 6be82375
Showing with 17 additions and 14 deletions
...@@ -5,17 +5,20 @@ p=input("你出什么?") ...@@ -5,17 +5,20 @@ p=input("你出什么?")
print("玩家出:"+p) print("玩家出:"+p)
t=random.choice(list) t=random.choice(list)
print("电脑出:"+t) print("电脑出:"+t)
if p==t: if p in list:
print("平局") if p==t:
elif p=="石头" and t=="剪刀": print("平局")
print("玩家win") elif p=="石头" and t=="剪刀":
elif p=="剪刀" and t=="布": print("玩家win")
print("玩家win") elif p=="剪刀" and t=="布":
elif p=="布" and p=="石头": print("玩家win")
print("玩家win") elif p=="布" and p=="石头":
elif t=="石头" and p=="剪刀": print("玩家win")
elif t=="石头" and p=="剪刀":
print("电脑win")
elif t=="剪刀" and p=="布":
print("电脑win") print("电脑win")
elif t=="剪刀" and p=="布": else:
print("电脑win") print("电脑win")
elif t=="布" and p=="石头": else:
print("电脑win") print("输入错误")
\ No newline at end of file \ 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