#include <string>
#include <sstream>
#include <iostream>
#include <locale>
int main()
{
setlocale(LC_ALL, "");
std::string text = "Помогите определить количество слов в строке и длину каждого из них на Си ++";
std::stringstream ss(text);
std::string s;
size_t count = 0;
for (; ss >> s; count++)
{
std::cout << s << " : " << s.size() << std::endl;
}
std::cout << "Total words: " << count << std::endl;
return 0;
}