package test;
public class P1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i =1 ; i<=9 ; i++){
for(int j=1 ; j<=i ; j++){
//System.out.print(i + "x"+ j + "=" + (i*j) + " ");
System.out.print(j + "x"+ i + "=" + (i*j) + " ");
}
System.out.println();
}
}
}
格式微调整后-》
package test;
public class P1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i =1 ; i<=9 ; i++){
for(int j=1 ; j<=i ; j++){
//System.out.print(i + "x"+ j + "=" + (i*j) + " ");
System.out.print(j + "x"+ i + "=" + (i*j) + "\t");
}
System.out.println();
}
}
}