Submit | All submissions | Best solutions | Back to list |
KINDJ - Kindergarten Counting Game |
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
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 |
hide comments
|
||||||
2011-11-19 20:03:00 Douglas Ferlini Bastos Machado[UNB]
Input data violates specifications. There are lines with zero words. (2) Indeed it does |
||||||
2011-11-16 05:01:00 octalc0de
Input data violates specifications. There are lines with zero words. |
||||||
2011-11-08 11:09:07 Rishabh Raj
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 |
||||||
2011-10-23 18:21:47 Nitin Sharma
taking input like this.. while(getline(cin,s,'\n'){ } |
||||||
2011-10-21 15:28:44 Don Dodson
There is no limit on the length of a line. Doesn't that make gets a bad idea? |
||||||
2011-09-24 15:25:28 RAJDEEP GUPTA
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.. |
||||||
2011-09-21 00:32:53 sukma arbianto s
i aggree with blashyrkh |
||||||
2011-09-20 18:38:20 blashyrkh
"Consecutive sequence of letters", so hello123hello are two words. Got AC with this assumption. |
||||||
2011-09-18 13:23:54 aparna
what is hello123hello.. 2 words or 1 word?? |