Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CI056 - Trabalho 1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matheus Horstmann
CI056 - Trabalho 1
Commits
f1c96007
Commit
f1c96007
authored
9 years ago
by
clm15@inf.ufpr.br
Browse files
Options
Downloads
Patches
Plain Diff
...
Signed-off-by:
Cristopher
<
clm15@inf.ufpr.br
>
parent
c2033800
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Quadra.c
+16
-4
16 additions, 4 deletions
Quadra.c
busca.o
+0
-0
0 additions, 0 deletions
busca.o
libbusca.a
+0
-0
0 additions, 0 deletions
libbusca.a
with
16 additions
and
4 deletions
Quadra.c
+
16
−
4
View file @
f1c96007
#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: "
);
fp
uts
(
" O usuario entrou com os seguintes valores :
\[ "
,
log
);
fp
rintf
(
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
)
{
{
...
...
This diff is collapsed.
Click to expand it.
busca.o
+
0
−
0
View file @
f1c96007
No preview for this file type
This diff is collapsed.
Click to expand it.
libbusca.a
+
0
−
0
View file @
f1c96007
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment