Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- #include <vector>
- #include <utility>
- #include <algorithm>
- using namespace std;
- struct Student {
- string Name;
- string Surname;
- int Day, Month, Year;
- };
- bool sort_name(Student& st1, Student& st2) {
- if (st1.Name == st2.Name)
- }
- int main() {
- int k; // число студентов
- cin >> k;
- vector<Student> students; // данные всех студентов
- for (size_t i = 0; i != k; ++i) {
- Student s;
- cin >> s.Name >> s.Surname >> s.Day >> s.Month >> s.Year;
- students.push_back(s);
- }
- string operation; // запрос
- cin >> operation;
- if (operation == "name") {
- sort(students.begin(), students.end(), sort_name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement