n = int(input("请输入三角形的层数:"))
i = 1
while i <= n:
j = 0
while j < n - i:
print(" ",end = "")
j = j + 1
j = 0
while j < 2 * i - 1:
print("*",end = "")
j = j + 1
print("")
i = i + 1
python:制作累加的三角形
最新推荐文章于 2024-11-12 23:15:59 发布