Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
262 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int main() 
{
    string s{};
    getline(cin, s);
    
    int y = 0;
    
    for (int i = 0; i < s.length(); i++ ){    if (s[i] == ' '){y++;} }
        
        
        
    
    
  cout << y;
  
}
Leave a Comment