码迷,mamicode.com
首页 > 其他好文 > 详细

输出一个矩阵,但这次是中空的

时间:2017-11-25 21:38:05      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:pre   input   输出   +=   int   while   print   else   矩阵   

lie=int(input(‘lie:‘))
hang=int(input(‘hang:‘))
phang=1
while phang<=hang:
plie=1
if phang==1 or phang==hang:
while plie<=lie:
print(‘*‘,end=‘‘)
plie+=1
while plie<=lie:
if plie==1 or plie==lie:
print(‘*‘,end=‘‘)
else:print(‘ ‘,end=‘‘)
plie+=1
phang+=1
print()

输出一个矩阵,但这次是中空的

标签:pre   input   输出   +=   int   while   print   else   矩阵   

原文地址:http://www.cnblogs.com/xusuns/p/7896279.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!