using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace ConsoleApplication1{ class Program { static void Main(string[] args) { for (int a = 1; a <= 9; a++)
今天用三种不同的方式实现了Shell脚本打印的九九乘法表,代码如下 方法1:使用for循环(a.sh) #!/bin/sh for i in {1,2,3,4,5,6,7,8,9} do for j in {1,2,3,4,5,6,7,8,9} do ((product=$i*$j)) echo -ne $i\*$j=$product"\t" done echo done exit 0 方法2:使用while循环(b.sh) #!/bin/sh i=1 j=1 while [ &quo