Project Euler - 1

3과 5의 배수

1000 미만의 자연수 중, 3과 5의 배수의 합을 구하라.
"""
Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.
"""


if __name__ == '__main__':
s = 0
for i in range(1, 1000):
if i % 3 == 0 or i % 5 == 0:
s += i

print(s)

댓글

  1. Bet365 casino games - Air Jordan Gaming
    Bet365 casino air jordan 18 stockx discount games how can i get air jordan 18 retro men – sports betting, where to order jordan 18 white royal blue live casino, and more. All you have to do is register good air jordan 18 retro a new account using website to buy air jordan 18 retro your chosen account.

    답글삭제

댓글 쓰기

이 블로그의 인기 게시물

Project Euler - 3

메인 스크립트

예외 처리