View Code of Problem 58

#include<bits/stdc++.h>
	using namespace std;
	int main(){
		string str;
		getline(cin,str);
		stringstream ss;
		ss<<str;
		int num = 0;
		string word;
		while(ss>>word)num++;
		cout<<num;
		return 0;
	}

Double click to view unformatted code.


Back to problem 58