解题思路:
注意事项:
参考代码:
import java.util.Arrays;
import java.util.Scanner;
public class A1114 {
public static void s(int e,int r,int t) {
int a[] = {e,r,t};
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
for (int z = 0; z < 3; z++) {
if (x != y && x != z && y != z) {
System.out.println(a[x]+" "+a[y]+" "+a[z]);
}
}
}
}
}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a[] = new int[4];
for(int i=0;i<a.length;i++) {
int b = sc.nextInt();
a[i] = b;
}
Arrays.sort(a);
int e = a[0];
int r = a[1];
int t = a[2];
int y = a[3];
s(e,r,t);
s(e,r,y);
s(e,t,y);
s(r,t,y);
}
}
0.0分
0 人评分