返回列表 發帖
  1. import java.io.*;
  2. import java.util.Arrays;
  3. public class Ch48 {
  4.    
  5.         int n[],len;
  6.         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  7.         String raw[];
  8.         Ch48() throws Exception
  9.         {
  10.                 System.out.print("enter some 整數");
  11.                 raw=br.readLine().split(" ");
  12.                 len=raw.length;
  13.                 for(int i=0;i<len;i++)
  14.                         n[i]=Integer.parseInt(raw[i]);
  15.                 Arrays.sort(n);
  16.                 for(int i=0;i<len;i++)
  17.                         System.out.print(n[i]+" ");
  18.                 System.out.println();
  19.         }
  20.         public static void main(String[] args) {
  21.         new        Ch48();
  22.         }

  23. }
複製代碼

TOP

返回列表