Advertisement
MARSHAL327

Untitled

Nov 28th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. void sort(book **beg) {
  2.     book* temp_i = *beg,
  3.         * temp_j = *beg;
  4.  
  5.     for (; temp_i; temp_i = temp_i->next) {
  6.         for (temp_j = temp_i; temp_j; temp_j = temp_j->next) {
  7.             if (temp_i->inf.cost > temp_j->inf.cost) {
  8.                 swap(temp_i->inf, temp_j->inf);
  9.             }
  10.         }
  11.     }
  12.  
  13.     cout << "Сортировка прошла успешно" << endl;
  14.     system("pause");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement