杨辉三角_python3
杨辉三角
http://www.nowcoder.com/questionTerminal/e671c6a913d448318a49be87850adbcc
l = [[0]*i for i in range(1, 31)] for i in range(30): for j in range(i+1): if j == 0 or i == j: l[i][j] = 1 else: l[i][j] = l[i-1][j-1] + l[i-1][j] n = int(input()) for i in range(n): for j in range(i+1): print('{:>5d}'.format(l[i][j]), end='') print()