class Demo{
public static void main(String[] args){
int[] arr = {1, 2, 3, 4};
int count = 0;
for(int i=0; i<arr.length; i++){
for(int j=0; j<arr.length; j++){
if(i == j)continue;
for(int z=0; z<arr.length; z++){
if(z == i || z == j)continue;
System.out.print(arr[i]+""+arr[j]+""+arr[z]);
System.out.println();
count++;
}
}
}
System.out.println("count = " + count);
}
}
|
|