Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string str;
- int i,c,l;
- while(getline(cin,str))
- {
- c=0;
- l=str.size();
- for(i=0; i<l; i++)
- {
- if((((str[i]>='a' && str[i]<='z')||(str[i]>='A' && str[i]<='Z')))
- && ((str[i+1]<'a' || str[i+1]>'z') && (str[i+1]<'A' || str[i+1]>'Z')))
- {
- c++;
- }
- }
- cout<<c<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement