Advertisement
Guest User

Untitled

a guest
May 27th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. Student *sortowanie(Student *glowa)
  2. {
  3.     Student *wsk = glowa;
  4.     while (wsk != NULL)
  5.     {
  6.         Student *poprz = NULL, *biez = glowa, *nastep = glowa->nast;
  7.         while (nastep != NULL)
  8.         {
  9.             if (nastep->ocena >0 && biez->ocena > nastep->ocena)
  10.             {
  11.                 biez->nast = nastep->nast;
  12.                 nastep->nast = biez;
  13.                 if (poprz != NULL)
  14.                 {
  15.                     poprz->nast = nastep;
  16.                 }
  17.                 else
  18.                 {
  19.                     glowa = nastep;
  20.                 }
  21.             }
  22.             poprz = biez;
  23.             biez = nastep;
  24.             nastep = nastep->nast;
  25.         }
  26.         wsk = wsk->nast;
  27.     }
  28.     return glowa;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement