#include <stdio.h> int main() { int a[6] = {8, 5, 7, 9, 4, 6}, i, j, k, t, min; int *p = a; for (j = 5; j >= 0; j--) { min = 0; for (k = 1; k <= j; k++) { if (*(p + min) >= *(p + k)) min = k; } t = *(p + min); *(p + min) = *(p + j); *(p + j) = t; } p = a; for (i = 0; i < 6; i++) printf(" %d", *(p + i)); return 0; }