Guest User

Untitled

a guest
Apr 27th, 2014
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Operatoriai:
  2.  
  3.     bool operator > (const Mazgas & xx) const
  4.     {
  5.         return (spausd > xx.spausd);
  6.     }
  7.     Mazgas & operator = (const Mazgas & xx)
  8.     {
  9.         spausd = xx.spausd;
  10.         return *this;
  11.     }
  12.  
  13.     bool operator > (const Spausdintuvas & kitas) const
  14.     {
  15.         if(kaina > kitas.kaina)
  16.             return true;
  17.         return false;
  18.     }
  19.  
  20. Rikiavimo funkcija:
  21.  
  22. void Parduotuve::Rikiuoti()
  23. {
  24.     Mazgas *tmp = new Mazgas;
  25.     for(Mazgas *dra = pr; dra != NULL; dra = dra->Pirmyn())
  26.     {
  27.         Mazgas *ats = dra;
  28.         for(Mazgas *drb = dra->Pirmyn(); drb != NULL; drb = drb->Pirmyn())
  29.             if(*ats > *drb)
  30.                 ats = drb;
  31.         *tmp = *ats;
  32.         *ats = *dra;
  33.         *dra = *tmp;
  34.     }
  35.     delete tmp;
  36. }
RAW Paste Data