Untitled
Anonymous
c_cpp
01/20/2024 4:05 PM
352 B
18
Indexable
#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;
}
Editor is loading...
Leave a Comment