#coding:utf-8
#import string
def dianshu(n,N):#input 总行数N 第n小行的点数
#*数目
if n <= (N+1)/2:
return (2*n-1)
else:
return 2*(N+1-n)-1
def print_lingxing(N):
if N%2==0:
print None
for iin range(1,N+1):
l_dian = dianshu(i,N)
l_kongge= (N-l_dian)/2
print " "*l_kongge +"*"*l_dian +" "*l_kongge
if __name__ =='__main__':
print_lingxing(7)
网友评论