#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
string text;
cout << "Введите текст: ";
getline(cin, text);
stringstream ss(text);
string word;
int count = 0;
cout << "\nСлова длиной 5 символов:" << endl;
while(ss >> word) {
if(word.length() == 5) {
cout << word << endl;
count++;
}
}
if(count == 0) {
cout << "Слова длиной 5 символов не найдены!" << endl;
} else {
cout << "\nНайдено слов: " << count << endl;
}
return 0;
}