프로젝트 오일러 27번
1234567891011121314151617181920212223242526272829resultA=0resultB=0tempCount=0sosooCount=0for a in range(-999,1000): for b in range(-999,1000): n=0 count=0 while(1): result=int(math.pow(n,2))+a*n+b if(result0): #소수가 아닌 경우 break else: #소수인 경우 count=count+1 n=n+1 if(tempCount
Algorithm/Project Euler
2017. 6. 29. 22:48
프로젝트 오일러 38번
123456789101112131415string=""temp=0for i in range(1,10000): string="" for j in range(1,10): if(len(string)+len(str(i*j))>9): break string=string+str(i*j) if(len(string)==9): #이 안에서 팬디지털 판정 if((string.find('1')!=-1 and string.find('2')!=-1 and string.find('3')!=-1 and string.find('4')!=-1 and string.find('5')!=-1 and string.find('6')!=-1 and string.find('7')!=-1 and string.find('8')!=-1 and stri..
Algorithm/Project Euler
2017. 6. 29. 20:51