蓝桥杯python组——数的分解
import os
import sys
def check(x):
y=str(x)
if '2' in y or '4' in y:
return 0
else:
return 1
s = 0
for i in range(1,672):
for j in range(i + 1,1009):
k = 2019 - i - j
if i < j < k and check(i) == 1 and check(j) == 1 and check(k):
s += 1
print(s)
最终答案为40785
谢谢大家的支持,您的一键三连是 罡罡同学前进的最大动力!