Untitled

as
mail@pastecode.io avatar
unknown
c_cpp
a month ago
321 B
0
Indexable
Never
#include <iostream>
#include <string>

using namespace std;

int main() {
    string input;
    getline(cin, input);

    int spaceCount = 0;
    for (char character : input) {
        if (character == ' ') {
            spaceCount++;
        }
    }


    cout << spaceCount << endl;

    return 0;
}
Leave a Comment