import random
aaa=0
for i in range(100000):
men = ['0','0','1']
ttt=[0,1,2]
random.shuffle(men)
cai=random.randint(0,2)
print('cai:',cai)
print('men:',men)
index=[i for i, x in enumerate(men) if x is '0']
index_bei=index
if cai in index:
index_bei.remove(cai)
index1=index_bei[0]
elif cai not in index:
index1=index[random.randint(0,1)]
#no
print('yang:',index1)
ttt.remove(index1)
ttt.remove(cai)
cai1=ttt[0]
print('huan:',cai1)
if men[cai1]=='1':
aaa+=1
# if men[cai]=='1':
# aaa+=1
input()
print(aaa)
三门问题的验证
于 2023-06-01 08:12:43 首次发布