Agorithm/백준 알고리즘

백준 알고리즘 9713번 Sum of Odd Sequence(python)

kimjinho1 2021. 2. 23. 00:14
728x90
반응형

단순 사칙연산 문제이다.

for _ in range(int(input())):
    N = int(input())
    print(sum([n for n in range(1, N+1) if n%2]))
728x90
반응형