Untitled
Michael
python
a year ago
1.7 kB
16
Indexable
'''
2024-7-4
計算那張圖
'''
def 新算法(LE,SV,LIC,LICV,LT,PCV,PC):
if (LE and SV):
# LA1=LA2=LA3=the_burner=True
return True
elif SV:
# SV=True, LE=False
# LA2 = LA3 = The_burner = True
LA1=(LIC or LICV)
return LA1
elif LE:
# SV=False LA1=LA2=True
# The_burner=LA3=result
LA3=(PC or PCV)
return LA3
else:
if LIC:
# LE=SV=False
# LA1=LA2=True LIC=True
LA3=(PC or PCV)
# the_burner=LA3
return LA3
else:
if PCV:
# LE=SV=LIC=False
# LA2=LA3=the_burner=True
# LA1=LICV
return LICV
else:
# LE=SV=LIC=PCV=False
LA1=LICV
LA2=LT
LA3=PC
the_burner=(LA2 and LA3)
return (LA1 and the_burner)
def 老算法(LE,SV,LIC,LICV,LT,PCV,PC):
LA3=(PCV or SV or PC)
print('LA3 = {}'.format(LA3))
LA2=(LE or LIC or LT or SV)
print('LA2 = {}'.format(LA2))
LA1=(LE or LIC or LICV)
print('LA1 = {}'.format(LA1))
The_burner=(LA2 and LA3)
print('The_burner = {}'.format(The_burner))
breakup_of_the_steam=(LA1 and The_burner)
print('breakup_of_the_steam = {}'.format(breakup_of_the_steam))
return breakup_of_the_steam
LE=True
LIC=False
LICV=False
LT=False
SV=False
PCV=False
PC=False
print('新算法')
print(新算法(LE,SV,LIC,LICV,LT,PCV,PC))
print('老算法')
print(老算法(LE,SV,LIC,LICV,LT,PCV,PC))
Editor is loading...
Leave a Comment