#include <stdio.h>
#define SIZE (10)
int main(void) {
int list[SIZE];
int i, j, t;
for (i
= 0; i
< SIZE
; i
++) printf("%d: %d\n", i
+ 1, list
[i
]);
for (i = 0; i < SIZE - 1; i++) {
for (j = i + 1; j < SIZE; j++) {
if (list[i] > list[j]) {
t = list[i]; list[i] = list[j]; list[j] = t;
}
}
}
for (i
= 0; i
< SIZE
; i
++) printf("%d: %d\n", i
+ 1, list
[i
]);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIFNJWkUgKDEwKQoKaW50IG1haW4odm9pZCkgewoKCWludCBsaXN0W1NJWkVdOwoJaW50IGksIGosIHQ7CgkKCXByaW50ZigiYmVmb3JlXG4iKTsKCWZvciAoaSA9IDA7IGkgPCBTSVpFOyBpKyspIHByaW50ZigiJWQ6ICVkXG4iLCBpICsgMSwgbGlzdFtpXSk7CgkKCWZvciAoaSA9IDA7IGkgPCBTSVpFIC0gMTsgaSsrKSB7CgkJZm9yIChqID0gaSArIDE7IGogPCBTSVpFOyBqKyspIHsKCQkJaWYgKGxpc3RbaV0gPiBsaXN0W2pdKSB7CgkJCQl0ID0gbGlzdFtpXTsgbGlzdFtpXSA9IGxpc3Rbal07IGxpc3Rbal0gPSB0OwoJCQl9CgkJfQoJfQoJCglwcmludGYoImFmdGVyXG4iKTsKCWZvciAoaSA9IDA7IGkgPCBTSVpFOyBpKyspIHByaW50ZigiJWQ6ICVkXG4iLCBpICsgMSwgbGlzdFtpXSk7CgoJcmV0dXJuIDA7Cn0K