Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
209 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string a;
	int b = 0;
	getline(cin, a);
	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] == ' ') b++;
	}
	cout << b;
}
Leave a Comment