package mianshiti;
public class T_1234 {
public static void main(String[] args) {
int[] num = new int[] {1, 2, 3, 4};
int[] kind = new int[500];
int count = 0;
for(int i = 0; i < num.length; i++) {
for(int j = 0; j < num.length; j++) {
for(int k = 0; k < num.length; k++) {
if(i == j || i == k || j == k) {
continue;
}
kind[count] = num[i]*1000 + num[j]*100 + num[k]*10 + num[6-i-j-k];
count++;
}
}
}
System.out.println(kind[count]);
count = 0;
while(count<kind.length){
if(kind[count]<1){
break;
}
System.out.println(kind[count]);
count++;
}
System.out.println(count);
}
}
|
|