Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <cstring>
- using namespace.std;
- int main()
- {char s[50];
- int n,i,k;
- gets(s);
- n=strlen(s);
- for(i=0;i<n;i++)
- if(s[i]==' ' || s[i]==',' || s[i]=='.')
- k++
- if(k!=0)
- cout<<k;
- else
- cout<<"In sir nu sunt spatii,virgule sau puncte";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement