题解 | #X形图案#
X形图案
http://www.nowcoder.com/practice/83d6afe3018e44539c51265165806ee4
双层循环
#双层循环
def print_pic(n):
for i in range(1,n+1):
for j in range(1,n+1):
if i==j or (i+j)==(n+1):
print("*",end="")
else:
print(" ",end="")
print()
while True:
try:
num=input()
print_pic(int(num))
except:
break