//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
#include
#include
#include
using namespace std;
int main()
{
fstream f("F1.txt");
size_t max_size;
string s, max_word, word;
while ( getline(f, s) ) {
istringstream is(s);
max_size = 0;
while (is >> word) {
if (max_size < word.size()) {
max_size = word.size();
max_word = word;
} else if (max_size == word.size()) {
max_word += " = ";
max_word += word;
}
}
cout << max_size << ' ' << max_word << endl;<br> }
}
_____________________________
Пример:
asfasfafs sdf sdg xcz
zxcvxcv sdggsd
asdgsdg
sgdgsd sdagsdg
gsd sdg sdg
sdggg sdg sh
Ответ:
9 asfasfafs
7 zxcvxcv
7 asdgsdg
7 sdagsdg
3 gsd = sdg = sdg
5 sdggg