#include #include #include #include #include using namespace std; void load(vector& o, ifstream& in) { string line; while (getline(in, line)) { o.push_back(line); } } bool compareSize(string l, string r) { return l.length() < r.length(); } int main() { ifstream in("osobe.txt"); vector o; load(o, in); in.close(); sort(o.begin(), o.end(), compareSize); for (size_t i = 0; i < o.size(); i++) { cout << o[i] << endl; } return 0; }