参考代码:
import java.util.Arrays;
import java.util.Scanner;
public class Main1128 {
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++) {
a[i] = sc.nextInt();
}
Arrays.sort(a);
for (int b : a) {
System.out.print(b+" ");
}
}
}
0.0分
1 人评分