标签:img http power lan code 大小 alt rsh com
使用Shell脚本完成菱形图形的绘制#! /bin/bash
read -p "请输入菱形大小:" g
for ((i=1;i<=$g;i++))
do
for ((j=$g;j>$i;j--))
do
echo -n " "
done
for ((p=1;p<=$i;p++))
do
echo -n "* "
done
echo ""
done
for ((k=$g-1;k>=1;k--))
do
for ((m=$g;m>$k;m--))
do
echo -n " "
done
for ((l=1;l<=$k;l++))
do
echo -n "* "
done
echo ""
done
标签:img http power lan code 大小 alt rsh com
原文地址:https://blog.51cto.com/14484404/2441337