Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- string x;
- getline(cin, x);
- int count = 1;
- for (const char &symbol : x) {
- if (isspace(symbol))
- count++;
- }
- cout << count << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment