欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  Java

Java经典编程题--九九乘法表

程序员文章站 2024-01-27 14:59:46
...
输出九九乘法表。

public class Example16 {
public static void main(String[] args) {
table(9);
}

public static void table(int n) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(j + "*" + i + "=" + j * i+"\t");
}
System.out.println();
}
}
}

以上就是Java经典编程题--九九乘法表的详细内容,更多请关注其它相关文章!