Doan logic 2

mail@pastecode.io avatar
unknown
plain_text
2 years ago
155 B
2
Indexable
Never
def f(x):
    if x == 1:
        return 0
    return f(x-1) + x


t = int(input())
while t > 0:
    t -= 1
    x = int(input())
    print(f(x))