Commit 41d44638 by BellCodeEditor

save project

parent eddb6fcf
Showing with 24 additions and 19 deletions
N=int(input('请输奶牛头数:'))
s=20*N*7
print(s)
\ No newline at end of file
import random while True
list=["石头","剪刀","布"] import random
plier=input('请输入:石头,剪刀,布') list=["石头","剪刀","布"]
computer=random.choice(list) plier=input('请输入:石头,剪刀,布')
print('玩家输入'+plier) computer=random.choice(list)
print('电脑输入'+computer) print('玩家输入'+plier)
if plier in list: print('电脑输入'+computer)
if computer==plier: if plier in list:
print('平局了!') if computer==plier:
elif plier=='剪刀' and computer=='布': print('平局了!')
print('你赢了!') elif plier=='剪刀' and computer=='布':
elif plier=='石头' and computer=='剪刀': print('你赢了!')
print('你赢了!') elif plier=='石头' and computer=='剪刀':
elif plier=='布' and computer=='石头': print('你赢了!')
print('你赢了!') elif plier=='布' and computer=='石头':
else: print('你赢了!')
print('电脑赢') else:
print('输入错误') print('电脑赢')
\ No newline at end of file print('输入错误')
\ 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