Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SortGr(int* arr, int a, int b)
- {
- for (int i = a; i < b - 1; ++i)
- {
- for (int j = b - 2; j >= i; --j)
- {
- if (arr[j] > arr[j + 1])
- {
- int t = arr[j];
- arr[j] = arr[j + 1];
- arr[j + 1] = t;
- }
- }
- }
- }
- void SortLe(int* arr, int a, int b)
- {
- for (int i = a; i < b - 1; ++i)
- {
- for (int j = b - 2; j >= i; --j)
- {
- if (arr[j] < arr[j + 1])
- {
- int t = arr[j];
- arr[j] = arr[j + 1];
- arr[j + 1] = t;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment