row=int(input(“请输入行数:”))
while row>10 or row<=0:
row=int(input(“请输入行数:”))
b=[[0 for i in range(0,j+1)] for j in range(0,row)]
for i in range(0,row):
for j in range(0,i+1):
if i==j or j==0:
b[i][j]=1
else:
b[i][j]=b[i-1][j]+b[i-1][j-1]
for m in b:
for n in m:
print str(n)+”\t”,
print ‘\n’