法一:
#!/bin/bash
n=1
while [ $n -lt 10 ]
do
for ((m=1;m<=$n;m++))
do
echo -n -e "${m}x${n}=$[m*n]\t"
done
echo
n=$((n+1))
done
**法二: **
#!/bin/bash
for j in {1..9}
do
for i in `seq $j`
do
echo -e -n "${i}x${j}=$[ $i * $j ]\t"
done
echo
done
**倒三角: **
#!/bin/bash
for j in {9..1..-1}
do
for i in `seq $j`
do
echo -e -n "${i}x${j}=$[ $i * $j ]\t"
done
echo
done
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/m0_51160032/article/details/120885577
内容来源于网络,如有侵权,请联系作者删除!