方法一:
int i=9;
int j=9;
while(i >= 1)
{
while((j <= i) && (j > 0))
{
System.out.print(i + "*" + j + "=" + j * j +" ");
j--;
}
System.out.println(" ");
i--;
j=i;
}
方法二:
public class Multiplcation {
public static void main(String[] args) {
for(int i=1;i<=9;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(j+"*"+i+"="+i*j+" ");
}
System.out.println("\n");//必须在第二个for循环之外
}
}
}