Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i=1,j,n,t,c;
- char s[200];
- scanf("%d",&t);
- while(i<=t)
- {
- c=1;
- gets(s);
- n=strlen(s);
- for(j=0;j<n;j++)
- {
- if(s[j]==' ')
- {
- c++;
- }
- }
- printf("%d\n",c);
- i++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement