Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6. int len, cou, j;
  7. char ch[1000];
  8. getchar();
  9. while (gets(ch)) {
  10. cou=1;
  11. len=strlen(ch);
  12. for(j=0; j<len; j++){
  13. if(ch[j]==' '){
  14. cou++;
  15. }
  16. }
  17. printf("%d\n", cou);
  18. cou = 0;
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement