public static void main(String[] args) {
int x = 0;
for (int i = 0; i < 2; i++) {
System.out.println("compare i:" + i + " " + ++x);
for (int j = 0; j < 3; j++) {
System.out.println("compare j:" + j + " " + ++x);
for (int k = 0; k < 4; k++) {
System.out.println("compare k:" + k + " " + ++x);//i与2比较2次,j6次,k24次
}
}
}
System.out.println();
x = 0;
for (int i = 0; i < 4; i++) {
System.out.println("compare i:" + i + " " + ++x);
for (int j = 0; j < 3; j++) {
System.out.println("compare j:" + j + " " + ++x);
for (int k = 0; k < 2; k++) {
System.out.println("compare k:" + k + " " + ++x);//i 4;j 12;k 24;
}
}
}
}