#!/bin/bash
for ((i=9;i>0;i--));do
for ((j=1;j<=i;j++));do
let "chengji=$i*$j"
echo -n "$j*$i=$chengji "
done
echo
done
正常打印
#!/bin/bash
for ((i=1;i<10;i++));do
for ((j=1;j<=i;j++)); do
let "chengji=$i*$j"
echo -n "$i*$j=$chengji "
done
echo
done
#!/bin/bash
for ((i=1;i<10;i++)); do
for ((j=1;j<=i;j++)); do
#let "chengji=i * j"
#((chengji=i*j))
#chengji=$i*$j
chengji=$((i*j))
#chengji=$[i*j]
#chengji=`expr $i \* $j`
#chengji=`echo $i*$j|bc`
echo -n "$j*$i=$chengji "
done
echo
done
来源:CSDN
作者:A4m1n
链接:https://blog.csdn.net/qq_41059600/article/details/99693294