![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Project Euler
sola_aptx4869
这个作者很懒,什么都没留下…
展开
-
project Euler 13
def problem_13(): f=open(a,"r") count=0 sum2=0 while count<100: line=f.readline() line=line.strip('\n') sum2=sum2+int(line) count=count+1 f.close() return sum2原创 2015-01-31 09:11:44 · 568 阅读 · 0 评论 -
project eulur 17
def calss(i): result=0 if i==1 or i==2 or i==6 or i==10: result=result+3 return result if i==4 or i==5 or i==9: result=4 return result if i==3 or i==7 or i==8 or i==40 or i==50 or i==60:原创 2015-01-31 10:28:44 · 511 阅读 · 0 评论 -
Project Euler 8
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=i原创 2015-01-30 15:55:46 · 484 阅读 · 0 评论 -
Project Euler 9
def probelm_9(): for i in range(2,500): if 500%i==0: a=i b=500/i-i if(a>b): return 2*a*b*(a*a-b*b)*(a*a+b*b) return -1原创 2015-01-30 16:06:11 · 538 阅读 · 0 评论 -
project euler 18/67
def get_count(): count=0 for line in f: count=count+1 return countm=100>>> numm=[[0]*(m+1) for i in range(0,m+1)]def scann(): f=open(a,"r") index=0 start=0 end=2 for line in f: line.s原创 2015-01-31 11:24:11 · 542 阅读 · 0 评论 -
project euler 19
def get_monthday(year,month): if month==1 or month==3 or month==5 or month==7 or month==8 or month==10 or month==12: return 31 elif month==4 or month==6 or month==9 or month==11: return 30 else原创 2015-01-31 16:34:31 · 526 阅读 · 0 评论 -
project euler 24
def problem_24(ini): basea=[0,1,2,3,4,5,6,7,8,9] result=[] for i in range(1,11): c=ini/jiec(10-i) b=ini%jiec(10-i) result.append(basea[c]) ff=basea.pop(c) print ff ini=b return result原创 2015-02-01 21:49:36 · 509 阅读 · 0 评论