解题思路:
注意事项:
参考代码:
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); int[] a = new int[n]; for (int i = 0; i < a.length; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); for (int i = a.length - 1; i >= 0; i--) { System.out.print(a[i] + " "); } System.out.println(); } } }
0.0分
1 人评分
C二级辅导-进制转换 (C语言代码)浏览:811 |
C语言训练-求PI* (C语言代码)浏览:883 |
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:1367 |
点我有惊喜!你懂得!浏览:2071 |
C二级辅导-计负均正 (C语言代码)浏览:576 |
陶陶摘苹果 (C语言代码)浏览:1603 |
C语言程序设计教程(第三版)课后习题7.4 (Java代码)浏览:839 |
C语言训练-计算一个整数N的阶乘 (C语言代码)浏览:928 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:676 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:701 |