import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner cs = new Scanner(System.in);
//在此输入您的代码...
int N = cs.nextInt();
int[] ass = new int[N];
for (int i = 0; i < N; i++) {
ass[i] = cs.nextInt();
}
Arrays.sort(ass);
for (int i = 0; i < N; i++) {
System.out.print(ass[i]+" ");
}
System.out.println();
for (int i = N-1; i >=0 ; i--) {
System.out.print(ass[i]+" ");
}
cs.close();
}
}
数组简单排序---蓝桥杯
最新推荐文章于 2024-11-08 11:06:20 发布