import java.io.*; import java.util.Arrays; /** * 把十个数读入数组,然后使用 Arrays.sort() 排序 */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws Exception { int[] num = new int[10]; for (int i = 0; i < 10; i++) { cin.nextToken(); num[i] = (int) cin.nval; } Arrays.sort(num); for (int i : num) { cout.println(i); } cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.4 (C++代码)浏览:681 |
字符逆序 (C语言代码)浏览:862 |
A+B for Input-Output Practice (VI) (C语言代码)浏览:602 |
C语言训练-排序问题<2> (C++代码)(sort函数)浏览:1720 |
校门外的树 (C语言代码)浏览:1166 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:609 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:806 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:545 |
哥德巴赫曾猜测 (C语言代码)浏览:1148 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:1267 |