#include <stdio.h>
int qtde_impar(int vetor[], int tamanho) {
int maior = 1; //precisaria ver se pode ter valores negativos
for (int cont = 0; cont < 10 ; cont++) if (vetor[cont] % 2 == 1 && vetor[cont] > maior) maior = vetor[cont];
return maior;
}
int main() {
int vetor[10] = { 8, 2, 1, 4, 5, 3, 7, 2, 9, 0 };
printf("%i\n", qtde_impar
(vetor
, 10)); }
//https://pt.stackoverflow.com/q/212605/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgcXRkZV9pbXBhcihpbnQgdmV0b3JbXSwgaW50IHRhbWFuaG8pIHsKCWludCBtYWlvciA9IDE7IC8vcHJlY2lzYXJpYSB2ZXIgc2UgcG9kZSB0ZXIgdmFsb3JlcyBuZWdhdGl2b3MKCWZvciAoaW50IGNvbnQgPSAwOyBjb250IDwgMTAgOyBjb250KyspIGlmICh2ZXRvcltjb250XSAlIDIgPT0gMSAmJiB2ZXRvcltjb250XSA+IG1haW9yKSBtYWlvciA9IHZldG9yW2NvbnRdOwoJcmV0dXJuIG1haW9yOwp9CgppbnQgbWFpbigpIHsKCWludCB2ZXRvclsxMF0gPSB7IDgsIDIsIDEsIDQsIDUsIDMsIDcsIDIsIDksIDAgfTsKCXByaW50ZigiJWlcbiIsIHF0ZGVfaW1wYXIodmV0b3IsIDEwKSk7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzIxMjYwNS8xMDE=