public static void main(String[] args) {
String [][] yh=new String[9][];
for(short i=0;i<yh.length;i++){
yh[i]=new String[i+1];
for (int j = 0; j < yh[i].length; j++) {
yh[i][j]=(i+1)+"*"+(j+1)+"="+(i+1)*(j+1);
}
}
for (int i = 0; i < yh.length; i++) {
for (int j = 0; j < yh[i].length; j++) {
System.out.print(yh[i][j]+"\t");
}
System.out.println();
}
}
时间: 2024-10-30 23:55:30