题目1 排序

 1 import java.util.Arrays;
 2 import java.util.Scanner;
 3  
 4 public class Main{
 5     public static void main(String[]args){
 6         Scanner in=new Scanner(System.in);
 7         int n=0;
 8         int[]nums=null;
 9         while(in.hasNext()){
10             n=in.nextInt();
11             nums=new int[n];
12             for(int i=0;i)
13                 nums[i]=in.nextInt();
14             Arrays.sort(nums);
15             for(int x:nums)
16                 System.out.print(x+" ");
17             System.out.println();
18         }
19     }
20 }
21 /**************************************************************
22     Problem: 1202
23     User: 0000H
24     Language: Java
25     Result: Accepted
26     Time:940 ms
27     Memory:81200 kb
28 ****************************************************************/

 

转载于:https://www.cnblogs.com/qq1029579233/p/4793819.html

你可能感兴趣的:(题目1 排序)