Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <set>
- #include <algorithm>
- using namespace std;
- int n;
- struct chel {
- string na, fa, cl, d;
- };
- bool operator< (chel a, chel b)
- {
- if (a.cl < b.cl) {
- return true;
- }
- if (a.cl == b.cl && a.fa <= b.fa) {
- return true;
- }
- return false;
- }
- chel c;
- set < chel > a;
- int main()
- {
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> c.fa >> c.na >> c.cl >> c.d;
- a.insert(c);
- }
- for (std::set<chel>::iterator i = a.begin(); i != a.end(); i++)
- cout << i->cl << " " << i->fa << " " << i->na << " " << i->d << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement