BC105 菱形图案
思路:
step1:分上下层打印;
代码如下:
while True:
try:
n = int(input())
i = 1
while i <= 2*n + 1:
j = n + 1
while j >= 1:
if i <= j:
if i >= j:
print('* ',end='')
else:
print(' ',end='')
elif i > j:
if i + j <= 2*n + 2:
print('* ',end='')
else:
print(' ',end='')
j -= 1
print()
i += 1
except:
break