Recent Posts
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Today
Total
관리 메뉴

Try

[ProjectEuler] 프로젝트 오일러 Problem 3 본문

Algorithm/ProjectEuler

[ProjectEuler] 프로젝트 오일러 Problem 3

HAS3ONG 2019. 6. 28. 00:46
ans = 600851475143

a = 2
while 1:
    if ans % a == 0:
        print(a)
        while 1:
            ans = ans // a
            if ans % a != 0:
                break
    a += 1


출처

http://euler.synap.co.kr/prob_detail.php?id=3

Comments