for((i=$1i>0i--))
do
for((j=1j<=ij++))
do
echo -n "* "
done
echo
done
输出结果
* * * * *
* * * *
* * *
* *
*
#!/bin/bashread -p "please input the longs:" long
for((i=1i<=$longi++))
do
for((j=$longj>ij--))
do
echo -n " "
done
for m in `seq 1 $i`
do
echo -n "+"
done
for((n=1n<in++))
do
echo -n "+"
done
echo ""
done
long为你自己输入的边长,如果有规定长度,把$long改成数就行
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)