shell:a99.shpython
#!/bin/bash for ((i=1;i<10;i++));do for((j=1;j<=$i;j++));do let num=$i*$j echo "$i * $j ="$num done echo done
Python:a99.pyshell
#!/usr/bin/python import sys for i in range(1,10): for j in range(1,i+1): print(" %d*%d=%d" % (i,j,i*j))
學習循環語句的好例子。bash