Advertisement
Guest User

Untitled

a guest
May 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. void sort() {
  2.     vector<Abonent> myVector;
  3.    
  4.     while (!st->empty()) {
  5.         myVector.push_back(s.front());
  6.         s.pop();
  7.     }
  8.    
  9.     while (!myVector.empty()) {
  10.         int maxIndex = 0;
  11.         for (int i = 0; i < myVector.size(); i++)
  12.             if (strcmp(myVector[i].NameLast, myVector[maxIndex].NameLast) < 0)
  13.                 maxIndex = i;
  14.        
  15.         s.push(myVector[maxIndex]);
  16.         myVector.erase(myVector.begin() + maxIndex);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement