//此类用于练习For循环,打印乘法口诀表
public class My_ForDemo {
public static void main(String[] args) {
/* //九九乘法表的解析如下:
int c = 7; //c的取值发生变化时 c = 8 ; c = 7 ; c = 6 .......
for (int j = 1; j <= c; j++) {
System.out.print(c + "*" + j + "=" + c * j + "\t");
}
*//*输出结果:
c = 9时 9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81
c = 8时 8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
c = 7时 7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
..........
* *//*
System.out.println();//换行*/
//==============================
通过for循环打印乘法表
最新推荐文章于 2023-01-25 22:14:24 发布