输入n个数,对其进行排序
import
java.util.Scanner;
import
java.util.Arrays;
public
class
Main{
public
static
void
main(String[] args){
Scanner in =
new
Scanner(System.in);
while
(in.hasNext()){
int
n = in.nextInt();
int
[] arr =
new
int
[n];
for
(
int
i=
0
;i<n;i++){
arr[i] = in.nextInt();
}
Arrays.sort(arr);
for
(
int
i=
0
;i<n;i++)
System.out.print(arr[i]+
" "
);
System.out.println();
}
}
}