BC107 箭形图案

思路:

step1:分三部分打印;

代码如下:

while True:
    try:
        n = int(input())
        for i in range(n):
            print(' ' * (2*n-2*i-1),'*' * (i+1))
        print('*' * (n+1))
        for i in range(n):
            print(' ' * (2*i + 1),'*' * (n-i))
    except:
        break