今天闺蜜发了一个刑侦科推理试题,我看了两下就想编程爆破,可怕,我竟然丧失了推理能力吗!!!
既然已经编程求解了,我就先把代码粘上来吧,然后我现在尝试自己去推一下,要是推出来我会补上推理过程的。
# -*- coding:utf-8 -*-
s = "ABCD"
def test(str):
if(str[4]=='C' and str[1]=='A') or (str[4]=='D' and str[1]=='B') or (str[4]=='A' and str[1]=='C') or ((str[4]=='B' and str[1]=='D')):
if(str[2]=='A' and str[5]==str[1] and str[3]==str[1] and str[1]!='A') or(str[2]=='D' and str[5]==str[1] and str[1]=='D' and str[3]!='D') or(str[2]=='C' and str[5]==str[3] and str[3]=='C' and str[1]!='C') or(str[2]=='B' and str[1]==str[3] and str[3]=='B' and str[5]!='B'):
if(str[3]=='A' and str[