SHARE
TWEET

2

a guest Apr 4th, 2020 232 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     int i=1,j,n,t,c;
  6.     char s[200];
  7.     scanf("%d",&t);
  8.     while(i<=t)
  9.     {
  10.         c=1;
  11.         gets(s);
  12.         n=strlen(s);
  13.         for(j=0;j<n;j++)
  14.         {
  15.             if(s[j]==' ')
  16.             {
  17.                 c++;
  18.             }
  19.         }
  20.         printf("%d\n",c);
  21.         i++;
  22.     }
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top