Essa segue a mesma lógica da anterior, grato pela ajuda.
Anexos:

Soluções para a tarefa
Respondido por
1
SEGUE O CÓDIGO EQUIVALENTE EM C:
#include <stdio.h>
int main()
{
int A[] = {2,4,1,4,6,12,21,6,10,12,23,3};
int i , j , k , x;
int n = (sizeof(A)/sizeof(A[0])); //Calcula quantidade de valores em A
for(i = 1 ; i < n ; i++)
{
k = i;
x = A[i];
for(j = i+1 ; j <= n; j++)
{
if(A[j] < x)
{
k = j;
x = A[j];
}
}
A[k] = A[i];
A[i] = x;
}
return 0;
}
kennedyp69p7z:
ah certo, obrigado.
A = [ 1 ] [ 3 ] [ 4 ] [ 4 ] [ 6 ] [ 6 ] [ 10 ] [ 12 ] [ 12 ] [ 12 ] [ 1 ] [ 23 ] [ 12 ] [ 16 ] [ 24 ] [ 16 ] [ 6422300 ] [ 3723264 ] [ 6422368 ] [ 4199048 ] [ 21 ] [ 11275496 ]
for(i = 0 ; i < n ; i++)
{
printf(" [ %d ]", A[i] );
}
A = [ 2 ] [ 1 ] [ 3 ] [ 4 ] [ 4 ] [ 6 ] [ 6 ] [ 10 ] [ 12 ] [ 12 ] [ 12 ] [ 1 ] [ 23 ] [ 12 ] [ 16 ] [ 24 ] [ 16 ] [ 6422300 ] [ 3993600 ] [ 6422368 ] [ 4199048 ] [ 21 ] [ 11144424 ]
Perguntas interessantes
Inglês,
11 meses atrás
Sociologia,
11 meses atrás
Geografia,
11 meses atrás
Química,
1 ano atrás
Matemática,
1 ano atrás
Matemática,
1 ano atrás
Biologia,
1 ano atrás