Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
krkris
/
Loogikafunktsioon
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c1342a4c
authored
Mar 18, 2022
by
erfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update .c
parent
b350b665
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
.c
.c
View file @
c1342a4c
...
...
@@ -5,12 +5,12 @@ int kontroll(char a[16]){
int
i
;
for
(
i
=
0
;
i
<
strlen
(
a
);
i
++
){
if
(
a
[
i
]
!=
'0'
&&
a
[
i
]
!=
'1'
){
printf
(
"Lubamatu sisend
\n
"
);
printf
(
"Lubamatu sisend
: %s
\n
"
,
a
);
return
1
;
}
}
if
(
strlen
(
a
)
!=
4
){
printf
(
"Lubamatu sisend
\n
"
);
printf
(
"Lubamatu sisend
%s
\n
"
,
a
);
return
1
;
}
return
0
;
...
...
@@ -50,11 +50,13 @@ int sisestus(const char tekst[40], char a[16], char b[16], char c[16], char d[16
printf
(
"Sisestage K-kaardi NELJAS rida
\n
"
);
scanf
(
"%s"
,
d
);
}
while
(
kontroll
(
d
)
==
1
);
printf
(
"
\n
"
);
printf
(
"
\n
Terviklik kaart:
\n
"
);
printf
(
"
\n
%s
\n
"
,
a
);
printf
(
"%s
\n
"
,
b
);
printf
(
"%s
\n
"
,
c
);
printf
(
"%s
\n
"
,
d
);
printf
(
"
\n
"
);
}
else
if
(
strlen
(
a
)
>=
16
){
...
...
@@ -64,27 +66,19 @@ int sisestus(const char tekst[40], char a[16], char b[16], char c[16], char d[16
return
1
;
}
}
printf
(
"
\n
"
);
printf
(
"Toevaartused: %s"
,
a
);
printf
(
"
\n
"
);
}
else
{
// Kui kasutaja sisestab mittesobiva märkide arvu, siis programm teeb exit.
printf
(
"Lubamatu sisend: %s"
,
a
);
printf
(
"Lubamatu sisend: %s
\n
"
,
a
);
return
1
;
}
return
0
;
}
/*char array[4][4] = {{
a[20],
b[20],
c[20],
d[20]
}};
int j;
for (i = 0; i < 4; i++){
for (j = 0; j < 4; j++){
printf("%c", array[i][j]);
}
}*/
return
0
;
}
void
info
(
char
a
[
16
],
char
b
[
16
],
char
c
[
16
],
char
d
[
16
]){
char
f0
;
...
...
@@ -222,11 +216,8 @@ void info(char a[16], char b[16], char c[16], char d[16]){
int
main
(
void
){
char
a
[
16
],
b
[
16
],
c
[
16
],
d
[
16
];
int
input
;
input
=
sisestus
(
"Sisestage 4x4 Karnaugh kaart voi 16 loogikavaartust:
\n
"
,
a
,
b
,
c
,
d
);
if
(
input
==
1
){
return
1
;
}
sisestus
(
"Sisestage 4x4 Karnaugh kaart voi 16 loogikavaartust:
\n
"
,
a
,
b
,
c
,
d
);
info
(
a
,
b
,
c
,
d
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment