def abc(n):
//Python的初始化二维数组,真是头疼
temp = [[0 for col in range(n)] for row in range(n)]
for i in range(1, n):
for j in range(0, i):
if j==0:
temp[i][j] = 1
else:
temp[i][j] = temp[i-1][j-1] + temp[i-1][j]
for i in range(0, n):
for j in range(0, i):
print(temp[i][j], end=" ")
print('\n');
|