@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();
}
}
}
执行效果:
如有问题请留言回复!