Untitled
asunknown
c_cpp
2 years ago
321 B
4
Indexable
#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;
}Editor is loading...
Leave a Comment