Recent Posts
«   2025/11   »
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 16 본문

Algorithm/ProjectEuler

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

HAS3ONG 2019. 7. 3. 22:22
num = 1
for i in range(1000):
    num *= 2

res = 0

while 1:
    if num < 10:
        res += num
        break

    res += num % 10
    num = num // 10

print(res)

출처

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

Comments