Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
663 B
0
Indexable
Never
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    vector <string> vectorrr;

    ifstream in("input.txt");
   
    int NumOfMax = 0, max = 0;
    int i = 0;
    string str;

    while (in)
    {
        in >> str;
        vectorrr.push_back(str);
        if (vectorrr.back().size() > max)
        {
            max = vectorrr.back().size();
            NumOfMax = i;
        }
        i++;
    }
    sort(vectorrr.begin(), (vectorrr.begin() + NumOfMax));
    for (int i = 0; i <= NumOfMax; i++)
    {
        cout << vectorrr[i] << endl;
    }
}