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