题解 | #X形图案#
X形图案
http://www.nowcoder.com/practice/83d6afe3018e44539c51265165806ee4
- 注意:判断的时候,副对角线。。。
lines=[]
while True:
try:
lines.append(int(input()))
except:
break
# print(lines)
for k in lines:
for i in range(k):
for j in range(k):
if i == j or i + j + 1 == k:
print("*",end="")
else:
print(" " ,end="")
print()