定义方法,实现打印九九乘法表
public class Test01{
public static void main(String
[] args
){
multipTable mymultipTable
= new multipTable();
mymultipTable
.multipTable1(9);
}
}
class multipTable{
public void multipTable1(int n
){
for (int i
=1;i
<=n
;i
++ ){
for (int j
=1;j
<=i
;j
++ ){
System
.out
.printf("%d * %d = %d\t",j
,i
,j
* i
);
}
System
.out
.println();
}
}
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-19102.html