#22379: Java解答參考


wayne71112 (悠人)

學校 : 大同大學
編號 : 127348
來源 : [123.51.254.186]
最後登入時間 :
2024-02-21 10:34:53
a104. 排序 -- yoooooooo | From: [36.226.178.142] | 發表日期 : 2020-08-28 13:14

import java.util.*;

public class tEst {

 

private static Scanner sc;

 

public static void main(String[] args) {

 

sc=new Scanner(System.in);

 

while(sc.hasNext()) {

 

int a=sc.nextInt();

int[] b=new int[a];

 

for(int i=0;i<a;i++) 

b[i]=sc.nextInt();

 

Arrays.sort(b);

 

for(int i=0;i<b.length;i++) 

System.out.print(b[i]+" ");

 

System.out.println();

 

}

}

}

 
ZeroJudge Forum