Untitled
unknown
c_cpp
a year ago
281 B
3
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