shell打印99乘法表

2019-01-23 11:03:40

shell打印99乘法表

  1. #!/bin/bash
  2. val=10
  3. for (( i = 1 ;i < ${val} ; i++)); do
  4. for (( y = 1; y <= ${i}; y ++ )); do
  5. sum=$[${i} * ${y}]
  6. echo -n "${i} x ${y} = ${sum} "
  7. done
  8. echo ""
  9. done

0
1
0

添加评论

正在回复:
取消
4
0
1
0