Java打印九九乘法表及倒打九九乘法表

//正打

public class Test3 {
public static void main(String[] args) {
for(int j=1;j<10;j++){
for(int i=1;i<=j;i++){
System.out.print(j+"*"+i+"="+j*i+"\t");
}
System.out.println();
}
}
}

//反打

public class Chengfa {
public static void main(String[] args) {
for(int i=9;i>0;i--){
for(int j=1;j<i+1;j++){

System.out.print(i+"*"+j+"="+(i*j)+" ");
}
System.out.println();

}

}
}

 

posted on 2019-03-13 14:43  不酷也要写代码  阅读(3313)  评论(0编辑  收藏  举报

导航