Java利用for循环打印完美格式的九九乘法表(Ziph)

@Java

完美格式的九九乘法表

如果有需要下方for循环知识的点击下方链接
打印水仙花数
打印各种三角形

大家好,我是Ziph!

代码:

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

执行效果:
九九乘法表
如有问题请留言回复!

拜拜

发布了13 篇原创文章 · 获赞 24 · 访问量 4233

猜你喜欢

转载自blog.csdn.net/weixin_44170221/article/details/104235065