返回列表 發帖
  1. public class tqc203
  2. {
  3.       public static void main(String args[])
  4.       {
  5.           if(args.length==1)
  6.           {
  7.               String a[]=args[0].split(",");
  8.               System.out.println("逗號隔開的字串個數有;"+a.length);
  9.               for(int i=0; i<a.length; i++)
  10.               {
  11.                   System.out.println((i+1)+"."+a[i]);
  12.               }
  13.           }else
  14.           {
  15.              System.out.print("參數錯誤!字串中不得有空白或必須以逗號隔開!");
  16.           }
  17.       }
  18. }
複製代碼

TOP

返回列表