HDU 1040 JAVA
来源:互联网 发布:linux qt调试器未设置 编辑:程序博客网 时间:2024/06/05 06:56
Problem Description
These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.
Give you some integers, your task is to sort these number ascending (升序).
You should know how easy the problem is now!
Good luck!
Input
Input contains multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains an integer N (1<=N<=1000 the number of integers to be sorted) and then N integers follow in the same line.
It is guarantied that all integers are in the range of 32-int.
Output
For each case, print the sorting result, and one line one case.
Sample Input
2
3 2 1 3
9 1 4 7 2 5 8 3 6 9
Sample Output
1 2 3
1 2 3 4 5 6 7 8 9
import java.util.Arrays;import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n-->0){ int num = sc.nextInt(); int a [] = new int [num]; for(int i=0;i<a.length;i++){ a[i] = sc.nextInt(); } Arrays.sort(a); for(int i:a){ if(i!=a[a.length-1]) System.out.print(i+" "); } System.out.println(a[a.length-1]); } }}
- HDU 1040 JAVA
- hdu acm hdu 2115 Java
- Exponentiation hdu 1063 java
- hdu 1313 (Java)
- 【Java】hdu 4043
- hdu 1242 Rescue<java>
- HDU 1002 JAVA
- hdu 2092(java)
- hdu 1063 java 高精度
- hdu 1106(java)
- hdu 1073(java)
- HDU-4762 Java高精度
- hdu 1002 java
- hdu 1089 java
- JAVA hdu 2192 MagicBuilding
- hdu 1001 java
- hdu 1002 java
- hdu 1003 java
- HDU 1048 JAVA
- [leetcode: Python]235. Lowest Common Ancestor of a BST
- Android Fragment完全解析
- 显卡内存一直被占用解决方式
- Maven对重复依赖的解决方案
- HDU 1040 JAVA
- Maven profile介绍
- ATS 6.2.1打release版本rpm包时插件中出现undefined symbol的问题追踪
- 【数据库】1库、引擎、约束、表、字段、数据
- UML建模详解
- bindingSource具体使用案例
- 数组操作(2)-二维数组
- 一种判断文件存在的方法
- input中text和password文本框的常用参数