package com.wyq.study;
public class ChengPlus {
public static void main(String[] args) {
//使用for循环输出
System.out.println("使用for循环输出九九乘法表");
for(int i=1;i<=9;i++){
for (int j=1;j<=i;j++){
System.out.print(j+"*"+i+"="+(i*j)+"\t");
}
System.out.println();
}
//使用while循环输出
System.out.println("使用while循环");
int k=1;
while(k<=9){
int l=1;
// for(int l=1;l<=k;l++){
// System.out.print(l+"*"+k+"="+(l*k)+"\t");
//
// }
while(l<=k){
System.out.print(l+"*"+k+"="+(l*k)+"\t");
l++;
}
k++;
System.out.println();
}
//使用do-while循环
System.out.println("使用do-while循环");
int m=1;
do{
int n=1;
// for(;n<=m;n++){
// System.out.print(n+"*"+m+"="+(m*n)+"\t");
// }
do{
System.out.print(n+"*"+m+"="+(m*n)+"\t");
n++;
}while(n<=m);
m++;
System.out.println();
}while(m<=9);
}
}