import java.io.IOException;
import java.io.InputStreamReader;
public class Danci {
public static void main(String[] args){
String str = new String();
System.out.print("請輸入壹個英文句子:");
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));//獲取鍵盤輸入
str = br.readLine();
}catch(IOException e){
e.printStackTrace();
}
String []s = str.split(" ");//轉換成數組
System.out.println("妳輸入的句子***有單詞 "+s.length+" 個");//s.length獲取數組長度
}
}
//此程序只能獲取壹句話的單詞個數.