Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <cstring>
- #include <algorithm>
- #include <set>
- #include <string>
- using namespace std;
- int n, i ,a ,b ,c ,f ,t ,y;
- long long x;
- char str[20];
- class pr_aff {
- private:
- char ml;
- long long mn;
- string name,sname,date;
- public: char Ml ()const{return ml;}
- long long Mn()const{return mn;}
- string Name()const{return name;}
- string SName()const{return sname;}
- string Date()const{return date;}
- };
- struct cmp{
- bool operator()(const pr_aff& a, const pr_aff& b) const{
- int i=0;
- if (a.Mn() != b.Mn()) return a.Mn() < b.Mn();
- if (a.Ml() != b.Ml()) return a.Ml() < b.Ml();
- while(a.Sname()==b.Sname())
- i++;
- return(a.Sname()<b.Sname());
- }
- };
- // pr_aff p;
- /* bool cl(Point x ,Point y)
- {
- int i=0;
- if (x.mn != y.mn) return x.mn < y.mn;
- if (x.ml != y.ml) return x.ml < y.ml;
- while(x.sname[i]==y.sname[i])
- i++;
- return(x.sname[i]<y.sname[i]);
- }*/
- int main()
- {
- std::set<pr_aff,cmp> myset;
- pr_aff p;
- cin>>n;
- for(i=0;i<=n-1;i++)
- {
- cin>>myset[i].Sname();
- cin>>myset[i].Name();
- cin>>str;
- cin>>myset[i].Date();
- int j=0;
- a=0;
- while(str[j]>='0' && str[j]<='9')
- {
- a++;
- j++;
- }
- x=0;
- for(int j=0;j<=a-1;j++)
- x=x*10+int(str[j])-int('0');
- myset[i].Mn()=x;
- myset[i].Ml()=str[a];
- }
- for(i=0;i<=n-1;i++)
- {
- cout<<myset[i].Mn()<<myset[i].Ml()<<" "<<myset[i].Sname()<<" "<<myset[i].Name()<<" "<<myset[i].Date<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement