#include <stdio.h>
//#include <stdlib.h>
#define _countof(ary) (sizeof(ary)/sizeof(ary[0]))
void swap(int ary[], int i, int j)
{
int tmp;
tmp = ary[i];
ary[i] = ary[j];
ary[j] = tmp;
}
int main()
{
int ary[] = {8, 8, 0, 1, 6, 8, 0, 0};
int i, j;
for (i = 0; i < _countof(ary) - 1; i++) {
for (j = i + 1; j < _countof(ary); j++) {
if (ary[i] > ary[j]) swap(ary, i, j);
}
}
for (i = 0; i < _countof(ary); i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8vI2luY2x1ZGUgPHN0ZGxpYi5oPgoKI2RlZmluZSBfY291bnRvZihhcnkpIChzaXplb2YoYXJ5KS9zaXplb2YoYXJ5WzBdKSkKCnZvaWQgc3dhcChpbnQgYXJ5W10sIGludCBpLCBpbnQgaikKewoJaW50IHRtcDsKCgl0bXAgPSBhcnlbaV07CglhcnlbaV0gPSBhcnlbal07Cglhcnlbal0gPSB0bXA7Cn0KCmludCBtYWluKCkKewoJaW50IGFyeVtdID0gezgsIDgsIDAsIDEsIDYsIDgsIDAsIDB9OwoJaW50IGksIGo7CgoJZm9yIChpID0gMDsgaSA8IF9jb3VudG9mKGFyeSkgLSAxOyBpKyspIHsKCQlmb3IgKGogPSBpICsgMTsgaiA8IF9jb3VudG9mKGFyeSk7IGorKykgewoJCQlpZiAoYXJ5W2ldID4gYXJ5W2pdKSBzd2FwKGFyeSwgaSwgaik7CgkJfQoJfQoJZm9yIChpID0gMDsgaSA8IF9jb3VudG9mKGFyeSk7IGkrKykgewoJCXByaW50ZigiJWQgIiwgYXJ5W2ldKTsKCX0KCXByaW50ZigiXG4iKTsKCXJldHVybiAwOwp9Cg==