Skip to content
Snippets Groups Projects
18.py 330 B
Newer Older
hacker717's avatar
hacker717 committed
n = int(input())
a, b = 1, 1
arr = []

while True:
    t = []
    f = False
    for _ in range(b):
        t.append(str(a))

        if a == n:
            f = True
            break

        a += 1
    arr.append(t)
    if f:
        break

    b += 1

ln = len(" ".join(arr[-1]))

for t in arr:
    print(f'{" ".join(t):^{ln}}')