回分類題庫
a011: 幼稚園的算數遊戲
關鍵字: ACM 494

Difficulity : 1 | 測資點: 1 ( 公開 ) | 評分方式: Tolerant Judge
Accepted : 1327 Users /1577 Times | Submit : 1796 Users /7974 Times | Accepted rate : 74%
Time Limit為: 1s | Memory Limit : 64MBytes
最近更新 : 2008-05-09 13:58

Content : 正體->简体

算一算每行有幾個字(word)。

Word的定義是連續的字元(letter: A~Z a~z)所組成的字。

Input :

一段文字(string)

Output :

字數(int)

Sample Input :help

若題目沒有特別說明,則應該以多測資的方式讀取,若不知如何讀取請參考 a001 的範例程式。
Hello everybody!!
This is school principal speeking.

Sample Output :

2
5

Hint :

* 中文翻譯:Lucky 貓 * 讀取整行 getline(cin, string) * ACM: Q494

Author :

ACM 494

Solve it! Status Forum Rank