Doan logic 2

Anonymous
plain_text
10/23/2022 2:05 AM
208 B
17
Indexable
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))
Editor is loading...