请问怎样得到这个结果
初始值:
line count serial
1 2 22
1 3 23
2 7 24
要得到的结果:
1122
1222
1323
1423
1523
2124
2224
2324
2424
2524
2624
2724
[解决办法]
怎么不是1,2,3 而是12345
[解决办法]
public class Test2 {
public static void main(String sts[]) {
int data[][] = { { 1, 2, 22 }, { 1, 3, 23 }, { 2, 7, 24 } };
int rows = data.length;
for (int i = 0; i < rows; i++) {
if (0 == i || (data[i][0] != data[i - 1][0])) {
for (int j = 0; j < data[i][1]; j++) {
System.out.print(data[i][0]);
System.out.print(" ");
System.out.print(j + 1);
System.out.print(" ");
System.out.println(data[i][2]);
}
} else {
int temp = data[i - 1][1] + data[i][1];
for (int j = data[i - 1][1]; j < temp; j++) {
System.out.print(data[i][0]);
System.out.print(" ");
System.out.print(j + 1);
System.out.print(" ");
System.out.println(data[i][2]);
}
}
}
}
}