两个循环就可以解决
public static void main(String[] args) {
//99乘法表
int n;
for (int a = 1; a <= 9; a++) {
for (int b = 1; b <= a; b++) {
n = a * b;
System.out.printf("%d*%d=%2d ", a, b, n);
}
System.out.println();
}
}