Untitled
unknown
c_cpp
2 years ago
262 B
8
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