⌨️

[AtCoder]ABC-162|B - FizzBuzz Sum

2023/03/10に公開

設問ページ

提出結果

def getInt():
    return int(input())


def main():
    n = getInt()

    c = 0
    for i in range(1, n + 1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        c += i
    print(c)


if __name__ == "__main__":
    main()

Discussion