Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Student *sortowanie(Student *glowa)
- {
- Student *wsk = glowa;
- while (wsk != NULL)
- {
- Student *poprz = NULL, *biez = glowa, *nastep = glowa->nast;
- while (nastep != NULL)
- {
- if (nastep->ocena >0 && biez->ocena > nastep->ocena)
- {
- biez->nast = nastep->nast;
- nastep->nast = biez;
- if (poprz != NULL)
- {
- poprz->nast = nastep;
- }
- else
- {
- glowa = nastep;
- }
- }
- poprz = biez;
- biez = nastep;
- nastep = nastep->nast;
- }
- wsk = wsk->nast;
- }
- return glowa;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement