Commit ef0b5f09 by BellCodeEditor

save project

parent 36cc01da
Showing with 16 additions and 3 deletions
...@@ -2,5 +2,18 @@ import random ...@@ -2,5 +2,18 @@ import random
SB=input("出 ") SB=input("出 ")
print("SB出"+SB) print("SB出"+SB)
a=["石头","剪刀","布"] a=["石头","剪刀","布"]
computer=random.choice(a) sb=random.choice(a)
print("电脑出"+computer) print("电脑出"+sb)
\ No newline at end of file if SB in a:
if sb==SB :
print("平")
elif sb=="石头" and SB=="剪刀" :
print("输")
elif sb=="剪刀" and SB=="石头":
print("输")
elif sb=="布" and SB=="石头":
print("输")
else:
print("赢")
else:
print("SB")
\ 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