Skip to content
Snippets Groups Projects
Commit f1c96007 authored by clm15@inf.ufpr.br's avatar clm15@inf.ufpr.br
Browse files

...


Signed-off-by: default avatarCristopher <clm15@inf.ufpr.br>
parent c2033800
No related branches found
No related tags found
No related merge requests found
#include "busca.h" #include "busca.h"
#include <time.h> #include <time.h>
FILE *log; FILE *log;
void vetSort(int *vet, int *vet_ord, int Tam, int max) void vetSort(int *vet, int *vet_ord, int Tam, int max)
...@@ -28,29 +29,40 @@ void jogar (int *vet, int *vet_ord, int N) ...@@ -28,29 +29,40 @@ void jogar (int *vet, int *vet_ord, int N)
{ {
int x, i = 0, j; int x, i = 0, j;
printf ("Entre com a Quadra de valores: "); printf ("Entre com a Quadra de valores: ");
fputs(" O usuario entrou com os seguintes valores : \[ ",log); fprintf(log, " O usuario entrou com os seguintes valores : [");
for (j = 0; j < 4; j++) for (j = 0; j < 3; j++)
{ {
scanf ("%d", &x); scanf ("%d", &x);
fprintf(log,"%d, ", x); fprintf(log,"%d, ", x);
fprintf(log // fprintf(log
if ((pesqseq(vet, x, N) != 0) || (pesqbin(vet_ord, x, N) != 0)) if ((pesqseq(vet, x, N) != 0) || (pesqbin(vet_ord, x, N) != 0))
i++; i++;
} }
fputs("\]\n",log); scanf ("%d", &x);
fprintf(log, "%d]\n",x);
if ((pesqseq(vet, x, N) != 0) || (pesqbin(vet_ord, x, N) != 0))
i++;
if (i == 4) if (i == 4)
{
printf ("Sucesso!!\n"); printf ("Sucesso!!\n");
fprintf(log,"Sucesso! Os numero inseridos estao contidos no vetor\n"); fprintf(log,"Sucesso! Os numero inseridos estao contidos no vetor\n");
}
else if (i > 1) else if (i > 1)
{
printf ("%d valores encontrados!\n", i); printf ("%d valores encontrados!\n", i);
fprintf (log,"%d valores encontrados!\n", i); fprintf (log,"%d valores encontrados!\n", i);
}
else if (i == 1) else if (i == 1)
{
printf ("1 valor encontrado!\n"); printf ("1 valor encontrado!\n");
fprintf (log,"1 valor encontrado!\n"); fprintf (log,"1 valor encontrado!\n");
}
else else
{
printf ("Nenhum valor encontrado!\n"); printf ("Nenhum valor encontrado!\n");
fprintf (log,"Nenhum valor encontrado!\n"); fprintf (log,"Nenhum valor encontrado!\n");
} }
}
void vetcpy (int *v1, int *v2, int N) void vetcpy (int *v1, int *v2, int N)
{ {
......
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment