Untitled
unknown
plain_text
3 years ago
663 B
8
Indexable
#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;
}
}Editor is loading...