It is known that in a group of n people. Write a program to enter the name of the group of students and sort this list alphabetically.
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { setlocale(0, "ru"); vector<string> students; string FIO; int n, j = 0, p = 0; cout << "Введите количество студентов в группе: "; cin >> n; cout << endl; for (int i = 0; i != n; i++) { cout << "Введите ФИО " << ++j << "го студента: "; getline(cin, FIO); students.push_back(FIO); } cout << "\nОтсортированный по алфавиту список студентов:" << endl; sort(students.begin(), students.end()); for (vector<string>::iterator it = students.begin(); it != students.end(); ++it) cout << ++p << ". " << *it << endl; system("pause"); return 0; } How to fix?
