Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <cstring>
  4.  
  5. using namespace.std;
  6.  
  7. int main()
  8. {char s[50];
  9. int n,i,k;
  10. gets(s);
  11. n=strlen(s);
  12. for(i=0;i<n;i++)
  13. if(s[i]==' ' || s[i]==',' || s[i]=='.')
  14. k++
  15. if(k!=0)
  16. cout<<k;
  17. else
  18. cout<<"In sir nu sunt spatii,virgule sau puncte";
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement