def yh(li):
list1 = []
list1.append(c)
s = len(li)
r = ""
for i in range(1, s):
r = eval(li[i - 1]) + eval(li[i])
rl = len(str(r))
g2 = []
for j in range(ysl - rl):
g2.append(" ")
ys = "".join(str(i) for i in g2) + str(r)
list1.append(ys)
list1.append(c)
print(list1)
return list1
阶乘
def jc(n):
sum = 1
for i in range(1, n + 1):
sum *= i
return sum
n = int(input())
lis = [1]
b = (n - 1) // 2
max = jc(n - 1) / jc(b) / jc(n - 1 - b)
max = int(max)
ysl = len(str(max))
g1 = []
for j in range(ysl - 1):
g1.append(" ")
c = "".join(str(i) for i in g1) + "1"
g3 = []
for j in range(ysl):
g3.append(" ")
jg = "".join(str(i) for i in g3)
for i in range(n):
gs = []
for j in range(n - i):
gs.append(jg)
sc = "".join(str(i) for i in gs) + jg.join(str(i) for i in lis)
print(sc)
lis = yh(lis)