#include int aux; void obterIndiceMenor(int vetor[], int inicio, int tamanho) { int i; aux = inicio; for (i = inicio+1; i < tamanho; i++) if (vetor[i] < vetor[aux]) aux = i; } void ordenaVetor(int vetor[], int tamanho) { int i; for (i = 0; i < tamanho - 1; i++) { obterIndiceMenor(vetor, i, tamanho); int aux1 = vetor[i]; vetor[i] = vetor[aux]; vetor[aux] = aux1; } } int main() { int i; int *v1 = malloc(sizeof(int) * 3); v1[0] = -9; v1[1] = -5; v1[2] = -8; int *v2 = malloc(sizeof(int) * 3); v2[0] = -2; v2[1] = -9; v2[2] = -3; int *v3 = malloc(sizeof(int) * 3); v3[0] = -9; v3[1] = -11; v3[2] = -6; // Qual eh o maior numero entre todos os vetores? aux = v1[0]; ordenaVetor(v1, 3); if (v1[2] > aux) aux = v1[2]; ordenaVetor(v2, 3); if (v2[2] > aux) aux = v2[2]; ordenaVetor(v3, 3); if (v3[2] > aux) aux = v3[2]; printf("O maior valor eh %d.", aux); return 0; }