Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- void RikiuotiMasyva(int iMasyvas[], int iMasyvoDydis)
- {
- int iMaziausias = 0;
- for (int i = 0; i < iMasyvoDydis - 1; i++)
- {
- iMaziausias = i;
- for (int j = i + 1; j < iMasyvoDydis; j++)
- {
- if (iMasyvas[j] < iMasyvas[iMaziausias])
- {
- iMaziausias = j;
- swap(iMasyvas[iMaziausias], iMasyvas[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement