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

  17.   }
  18. }
複製代碼

TOP

返回列表