方法一: 1 #!/bin/bash 2 for a in {1..9};do 3 for b in {1..9};do 4 c=`echo "$a*$b" |bc` 5 if [ "$a" -ge "$b" ];then 6 echo -n -e "$b*$a=$c\t" 7 fi 8 done 9 echo 10 done 方法二: 1 #!/bin/bash 2 for a in `seq 1 9`;do 3 for b…
需求:实现99乘法表 代码: #!/usr/bin/env python # -*- coding:utf-8 -*- #author chenjing for i in range(10): for j in range(1,i+1): print(j, 'x', i, '=', i*j,end='\t') #使用\t美化排版 print() #当内层循环结束后,打印换行 效果: 完美!…