Untitled
unknown
c_cpp
2 years ago
281 B
4
Indexable
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
getline(cin, str);
int i = 0;
for (char ch : str)
{
if (ch == ' ')
{
i++;
}
}
cout << i << endl;
return 0;
}Editor is loading...
Leave a Comment