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语言代码)浏览:944 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:672 |
【矩阵】 (C++代码)浏览:999 |
DNA (C语言描述,蓝桥杯)浏览:1653 |
Cylinder (C语言描述,蓝桥杯)浏览:1279 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:750 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:383 |
DNA (C语言代码)浏览:837 |
模拟计算器 (C语言代码)浏览:2366 |
1134题解(求分析)浏览:795 |