#include<iostream.h>
#include<stdio.h>
int main()
{
char str[80];
int i, count = 1;
couit<<"\n Enter any string (max. 80):";
gets(str);
for(i=0;str[i]!='\0'; ++i)
{
if(str[i]=='')
{
count ++;
while(str[i]=='')
i++;
}
if(str[i] == '\0')
i--;
}
cout<<"\n Number of words in a string are:"<<count;
return 0;
}