#include <stdio.h>
int main(void) {
int k = 6;
int matriz[] = {6,5,1,3,2,4};
int i;
int j;
for (i = 0; i < k-1; i++)
{
for (j = i+1; j < k; j++)
{
if (matriz[i] > matriz[j])
{
int aux = matriz[i];
matriz[i] = matriz[j];
matriz[j] = aux;
}
}
}
for (i = 0; i < k; i++)
{
printf("Posicao %d: %d", i
+ 1, matriz
[i
]); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CgkKCWludCBrID0gNjsKCWludCBtYXRyaXpbXSA9IHs2LDUsMSwzLDIsNH07CiAKCWludCBpOwoJaW50IGo7Cglmb3IgKGkgPSAwOyBpIDwgay0xOyBpKyspCiAgICB7CiAKICAgICAgICBmb3IgKGogPSBpKzE7IGogPCBrOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBpZiAobWF0cml6W2ldID4gbWF0cml6W2pdKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpbnQgYXV4ID0gbWF0cml6W2ldOwogICAgICAgICAgICAgICAgbWF0cml6W2ldID0gbWF0cml6W2pdOwogICAgICAgICAgICAgICAgbWF0cml6W2pdID0gYXV4OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogCiAgICBwcmludGYoIlxuIik7CiAgICBwcmludGYoIk9SREVOQURPOiAiKTsKICAgIHByaW50ZigiXG4iKTsKICAgIGZvciAoaSA9IDA7IGkgPCBrOyBpKyspCiAgICB7CiAgICAgICAgcHJpbnRmKCJQb3NpY2FvICVkOiAlZCIsIGkgKyAxLCBtYXRyaXpbaV0pOwogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KIAogICAgcHJpbnRmKCJcbiIpOwogICAgcHJpbnRmKCJcbiIpOwoJcmV0dXJuIDA7Cn0K