Read an input text from the console and print the number of words. By word we mean a sequence of characters separated by one or several spaces.
If the input is empty or there are no characters except spaces, print 0.
Read an input text from the console and print the number of words. By word we mean a sequence of characters separated by one or several spaces.
If the input is empty or there are no characters except spaces, print 0.
Sample Input 1:
one two threeSample Output 1:
3Sample Input 2:
between us several space charactersSample Output 2:
5Create a free account to access the full topic