虽然说平生最整不过的就是数学题了,但是好在我会写程序
z = 0
for i in range(1000000000):
temp = i
contains_2_or_5 = False
while temp > 0:
if temp % 10 == 2 or temp % 10 == 5:
contains_2_or_5 = True
break
temp = temp // 10
if contains_2_or_5:
z += 1
else:
while i > 0:
if i % 10 == 0:
z += 1
break
i = i // 10
print(z)
就是数太大了,到现在还没算出来第一题,第二题就不算了