标签:乘法 one while循环 image += 循环嵌套 结果 com while
#!/bin/bash
for i in `seq 1 9`;
do
for j in `seq 1 $i`;
do
let "k=$i*$j"
echo -ne "$i*$j=$k\t"
done
echo
done
输出结果
#!/bin/bash
a=1
while [ $a -le 9 ]
do
b=1
while [ $b -le $a ]
do
let "c=$a*$b"
echo -ne "$a*$b=$c\t"
let "b+=1"
done
echo
let "a+=1"
done
输出结果
#!/bin/bash
a=1
until [ $a -gt 9 ]
do
b=1
until [ $b -gt $a ]
do
let "c=$a*$b"
echo -ne "$a*$b=$c\t"
let "b+=1"
done
echo
let "a+=1"
done
输出结果:
标签:乘法 one while循环 image += 循环嵌套 结果 com while
原文地址:https://www.cnblogs.com/hxlinux/p/12939984.html