diff --git a/Arquivos/Estruturas.h b/Arquivos/Estruturas.h index 4ecf344e5c95cac3a9882799d7b7121fa9de7312..4a1afc5524d5bf08eb2bccfeb8ffb1e6a0854d19 100644 --- a/Arquivos/Estruturas.h +++ b/Arquivos/Estruturas.h @@ -4,5 +4,5 @@ #include <stdlib.h> #include <stdbool.h> #include <sys/time.h> -#define TAM 100 //tamanho do vetor -#define NUMMAX 50 //constante que tem o máximo de valores +#define TAM 5 //tamanho do vetor +#define NUMMAX 10 //constante que tem o máximo de valores diff --git a/Arquivos/Loteria b/Arquivos/Loteria index 3380a6027ca5e43394153b3fe944f969084885ca..9b691119028aa40a59e5988ad5f3e9c42a8f0814 100755 Binary files a/Arquivos/Loteria and b/Arquivos/Loteria differ diff --git a/Arquivos/Pesquisa.c b/Arquivos/Pesquisa.c index 033a1c5eefaf3d00ae4c7b87d6f1473223bfa1ef..12f697ab1c9b0265d84990aad20a881542e5647e 100644 --- a/Arquivos/Pesquisa.c +++ b/Arquivos/Pesquisa.c @@ -22,7 +22,7 @@ int PesquisaBinaria (int *Vetor, int Elem) { int PesquisaSequencial(int *Vetor, int Elem) { int i; - Vetor[0] = Elem; + for (i = 0; i < TAM; i++) { if (Vetor[i] == Elem) return i; @@ -36,7 +36,7 @@ void VerificaNumero (int *Vetor, int *Escolhidos) { acertos = 0; for (i = 0; i < 4; i++) - if (PesquisaBinaria (Vetor, Escolhidos[i]) != -1) { + if (PesquisaSequencial (Vetor, Escolhidos[i]) != -1) { printf ("Acertou o Numero %d, Parabéns\n", Escolhidos[i]); acertos++; }