Advertisement
icatalin

sortare eficienta struct

Dec 7th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. inline bool cmp(const el a, const el b)
  2. {
  3.     if (a.i==b.i)
  4.         return a.s>b.s;
  5.     else
  6.         return a.i<b.i;
  7. }
  8.  
  9. void sortare()
  10. {
  11.     sort(v+1,v+n+1,cmp);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement