while循坏
public static void main(String[] args) {
int x=1;//定义行和列
int y=1;
while (x <= 9) { //x进行循坏
y = 1;
while (y <= x) { //y进行循坏
System.out.print(y + "*" + x + "=" + y * x + "\t");//计算循坏的结果
y++;//y 的自增
}
System.out.println();
x++;//x 的自增
}
}
for循坏
public static void main(String[] args) {
for (int j = 1; j <= 9; j++) {
for (int i = 1; i <= j; i++) {
System.out.print(j+"*"+i+"="+(j*i) + "\t");
}
System.out.println();
}
}(根据哔哩哔哩的狂神说Java老师讲的进行的实践)
标签:九九乘法,int,System,while,循坏,out From: https://www.cnblogs.com/yangruoting-01/p/17022789.html