返回列表 發帖
  1. import java.util.Arrays;
  2. public class Ch14
  3. {

  4.         public static void main(String[] args)
  5.         {
  6.                 int n[]={65,34,6,4,2,354,5,43,-343,675};
  7.         System.out.print("排序前:");
  8.         for(int i=0;i<n.length;i++)
  9.         {
  10.                 System.out.print(n[i]+" ");
  11.         }
  12.                 Arrays.sort(n);
  13.                 System.out.print("\n排序後:");
  14.         for(int i=0;i<n.length;i++)
  15.         {
  16.                 System.out.print(n[i]+" ");
  17.         }
  18.         
  19.         }

  20. }
複製代碼

TOP

返回列表