/** * @Author DragonOne * @Date 2021/9/4 19:40 */ publicclassMain{ publicstaticvoidmain(String[] args)throws Exception { Scanner Scin = new Scanner(System.in); StreamTokenizer STcin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); BufferedReader BRcin = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
finalint maxn = (int) 20 + 5;
int n; STcin.nextToken(); n = (int) STcin.nval; //输入n个数 int[] a = newint[maxn];
for (int i = 0; i < n; i++) { STcin.nextToken(); a[i]=(int) STcin.nval; } for (int it : a) { //区别之处 System.out.println(it); } System.out.println("===================================="); Arrays.sort(a); for (int it : a) { //区别之处 System.out.println(it); }
/** * @Author DragonOne * @Date 2021/9/4 19:40 */ publicclassMain{ publicstaticvoidmain(String[] args)throws Exception { Scanner Scin = new Scanner(System.in); StreamTokenizer STcin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); BufferedReader BRcin = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
finalint maxn = (int) 20 + 5;
int n; STcin.nextToken(); n = (int) STcin.nval; //输入n个数 int[] a = newint[maxn];
for (int i = 0; i < n; i++) { STcin.nextToken(); a[i]=(int) STcin.nval; } for (int it : a) { System.out.println(it); } System.out.println("===================================="); // Arrays.sort(a); Arrays.sort(a,0,n); //区别之处【0,n) for (int it : a) { System.out.println(it); }