def problem_8(s):
result=0
ini=1
count=0
for i in range(0,13):
if int(s[i])==0:
count=count+1
start=0
end=13
while end<1000:
if count==0:
ini=1
for i in range(start,end):
ini=ini*int(s[i])
if(ini>result):
result=ini
if int(s[start])==0:
count=count-1
start=start+1
if int(s[end])==0:
count=count+1
end=end+1
return result
Project Euler 8
最新推荐文章于 2019-08-27 19:48:15 发布