public class MultiplicationTable {
public static void main(String[] args) {
System.out.print(" Multiplication Table\n");
System.out.print(" ");
for(int i=1;i<=9;i++) {
System.out.print(" "+i);
}
System.out.println("\n-------------------------------------------");
for(int j=1;j<=9;j++) {
System.out.print(j+ " | ");
for(int i=1;i<=9;i++) {
System.out.printf("%4d",i*j);
}
// System.out.println(); //写这一行使为了换行
}
}
}
打印九九乘法表
最新推荐文章于 2019-07-13 08:08:54 发布