目录
前言
程序实现此题更加容易
一、题目
二、简要步骤
三、代码实现
'''p表示赵去
q代表钱去
r代表孙去
s代表李去
t代表周去'''
ls=[0,1]
for p in ls:
for q in ls:
for r in ls:
for s in ls:
for t in ls:
A=(not p or q)
B=(s or t)
C=(q and not r)or(not q and r)
D=(r and s)or(not r and not s)
E=(not t or(p and q))
if(A and B and C and D and E):
print("p:{} q:{} r:{} s:{} t:{}".format(p,q,r,s,t))#1代表去,0代表不去
四、运行结果
总结
此题也沿用上面的步骤即可