运维网's Archiver
论坛
›
Shell/Powershell
› shell打印正三角形
果果、
发表于 2018-8-21 07:50:29
shell打印正三角形
#!/bin/bash
read -p "please input the lenth:" n
for i in `seq 1 $n`
do
for ((j=$n;j>i;j--))
do
echo -n " "
done
for m in `seq 1 $i`
do
echo -n "* "
done
echo
done
页:
[1]
查看完整版本:
shell打印正三角形