#ifndef POINTER07_H_
#define POINTER07_H_
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
void sort_pointer(int *p[], int n);
int main() {
int arr[5000], n, *pointer[5000];
arr[0] = 1;
arr[1] = 3;
arr[2] = 4;
arr[3] = 5;
arr[4] = 2;
pointer[0] = &arr[0];
pointer[1] = &arr[2];
pointer[2] = &arr[3];
pointer[3] = &arr[4];
pointer[4] = &arr[1];
n = 5;
sort_pointer(pointer, n);
for(int i = 0; i < n; i++) {
printf("%d", *pointer[i]);
(i < n - 1)? printf(" "):printf("\n");
}
fclose(stdout);
return 0;
}
#endif // POINTER07_H_
I2lmbmRlZiBQT0lOVEVSMDdfSF8KI2RlZmluZSBQT0lOVEVSMDdfSF8KI2luY2x1ZGUgPGNhc3NlcnQ+CiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxjc3RyaW5nPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCnZvaWQgc29ydF9wb2ludGVyKGludCAqcFtdLCBpbnQgbik7CgppbnQgbWFpbigpIHsKICBpbnQgYXJyWzUwMDBdLCBuLCAqcG9pbnRlcls1MDAwXTsKICBhcnJbMF0gPSAxOwogIGFyclsxXSA9IDM7CiAgYXJyWzJdID0gNDsKICBhcnJbM10gPSA1OwogIGFycls0XSA9IDI7CiAgcG9pbnRlclswXSA9ICZhcnJbMF07CiAgcG9pbnRlclsxXSA9ICZhcnJbMl07CiAgcG9pbnRlclsyXSA9ICZhcnJbM107CiAgcG9pbnRlclszXSA9ICZhcnJbNF07CiAgcG9pbnRlcls0XSA9ICZhcnJbMV07CiAgbiA9IDU7CiAgc29ydF9wb2ludGVyKHBvaW50ZXIsIG4pOwogIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgIHByaW50ZigiJWQiLCAqcG9pbnRlcltpXSk7CiAgICAoaSA8IG4gLSAxKT8gcHJpbnRmKCIgIik6cHJpbnRmKCJcbiIpOwogIH0KICBmY2xvc2Uoc3Rkb3V0KTsKICByZXR1cm4gMDsKfQojZW5kaWYgLy8gUE9JTlRFUjA3X0hfCg==