直角三角形输出九九乘法表

选择乘法口诀助记功能,输出阶梯形式的99乘法口诀表
1
1=1
12=2 22=4
13=3 23=6 33=9
1
4=4 24=8 34=12 44=16
1
5=5 25=10 35=15 45=20 55=25
16=6 26=12 36=18 46=24 56=30 66=36
17=7 27=14 37=21 47=28 57=35 67=42 77=49
1
8=8 28=16 38=24 48=32 58=40 68=48 78=56 88=64
1
9=9 29=18 39=27 49=36 59=45 69=54 79=63 89=72 99=81

package first;

public class 九九乘法表 {

        public static void main(String [] args){
        int a,b;
        for (a=1;a<=9;a++){
            for (b=1;b<=a;b++){
                System.out.print(b+"*"+a+"="+a*b+"\t");
            }
            System.out.print("\n");
        }
    }
}
发布了17 篇原创文章 · 获赞 1 · 访问量 131

猜你喜欢

转载自blog.csdn.net/qq_43300003/article/details/104905626