import random
player = int(input('请输入0(石头),1(剪刀),2(布):'))
computer = random.randint(0,2)
if (player == 0 and computer == 1) or (player == 1 and computer == 2) or (player == 2 and computer == 0):
print('电脑出的是',computer,'你出的是',player,'你赢了')
elif (player == computer):
print('电脑出的是',computer,'你出的是',player,'平手')
else:
print('电脑出的是',computer,'你出的是',player,'你输了')