Fork me on GitHub

NYOJ之三个数从小到大排序

-------------------------------------------

AC代码:

 1 import java.util.Arrays;
 2 import java.util.Scanner;
 3 
 4 public class Main {
 5 
 6     public static void main(String[] args) {
 7         
 8         Scanner sc=new Scanner(System.in);
 9         
10         int x[]=new int[3];
11         for(int i=0;i<x.length;i++){
12             x[i]=sc.nextInt();
13         }
14         
15         Arrays.sort(x);
16         
17         for(int i=0;i<x.length;i++){
18             System.out.print(x[i]+" ");
19         }
20         
21     }
22     
23 }

 

题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=41

posted @ 2016-08-21 01:32  CC11001100  阅读(185)  评论(0编辑  收藏  举报