public class xunhuan {
public static void main(String[] args) {
for (int i = 1; i<10; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(i + "*" + j + "=" +i*j +"\t");
}
System.out.println();
}
}
}
while循环做九九乘法表
public class chengfabiao {
public static void main(String[] args) {
int mum = 9;
int i=1;
while(i<=mum){
int j=1;
while(j<=i){
System.out.print(j + " X " + i + " = " + (j * i) + "\t");
j++;
}
System.out.println();
i++;
}
}
}
dowhile做九九乘法表
public class chengfabiao {
public static void main(String[] args) {
int mum = 9;
int i =1;
do{
int j=1;
do{
System.out.print(j + " X " + i + " = " + (j * i) + "\t");
j++;
}while(j<=i);
System.out.println();
i++;
}while(i<=mum);
}
}