Day04-循环结构
循环结构
打印九九乘法表
public class Demo04 {
//打印九九乘法表
public static void main(String[] args) {
String sum = "";
int chengji = 0;
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
sum = j + "x" + i;
chengji = i * j;
System.out.print(sum + "=" + chengji + "\t");
}
System.out.print("\n");
}
}
}