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