KINDJ - Kindergarten Counting Game

no tags 

Everybody sit down in a circle. Ok. Listen to me carefully.

``Woooooo, you scwewy wabbit!''

Now, could someone tell me how many words I just said?

 

Input and Output

Input to your program will consist of a series of lines, each line containing multiple words (at least one). A ``word'' is defined as a consecutive sequence of letters (upper and/or lower case).

Your program should output a word count for each line of input. Each word count should be printed on a separate line.

 

Sample Input

Meep Meep!
I tot I taw a putty tat.
I did! I did! I did taw a putty tat.
Shsssssssssh ... I am hunting wabbits. Heh Heh Heh Heh ...

 

Sample Output

2
7
10
9

hide comments
Douglas Ferlini Bastos Machado[UNB]: 2011-11-19 20:03:00

Input data violates specifications. There are lines with zero words. (2)
Indeed it does

octalc0de: 2011-11-16 05:01:00

Input data violates specifications. There are lines with zero words.

Rishabh Raj: 2011-11-08 11:09:07

im getting TLE. dont know why. timing seems perfect. i guess the execution is not stopping but i have given the EOF condition and scanning Char by Char ...

using string scaaning got accepted.. ? :O

Last edit: 2011-11-08 11:34:00
Nitin Sharma: 2011-10-23 18:21:47

taking input like this..
while(getline(cin,s,'\n'){
}

Don Dodson: 2011-10-21 15:28:44

There is no limit on the length of a line. Doesn't that make gets a bad idea?

RAJDEEP GUPTA: 2011-09-24 15:25:28

I took input like this(in C):
while(gets(string))
{
//....
}

.: 2011-09-22 18:19:18

can any one tell me how to end the test cases...am using getline for input purpose..

sukma arbianto s: 2011-09-21 00:32:53

i aggree with blashyrkh

blashyrkh: 2011-09-20 18:38:20

"Consecutive sequence of letters", so hello123hello are two words. Got AC with this assumption.

aparna: 2011-09-18 13:23:54

what is hello123hello.. 2 words or 1 word??


Added by:Andres Tellez
Date:2011-09-12
Time limit:0.600s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64