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
9716da04
authored
Apr 11, 2022
by
krkris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Kood.c
parent
58d71dc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
45 deletions
Kood.c
Kood.c
View file @
9716da04
...
...
@@ -111,48 +111,7 @@ int sisestus(const char tekst[40], char a[16], char b[16], char c[16], char d[16
// Reed-Mulleri polünoomi kujul oleva loogikafunktsiooni kohta info andmine:
void
info
(
char
a
[
16
],
char
b
[
16
],
char
c
[
16
],
char
d
[
16
],
char
f0
,
char
f1
,
char
f2
,
char
f3
,
char
f4
,
char
f5
,
char
f6
,
char
f7
,
char
f8
,
char
f9
,
char
fA
,
char
fB
,
char
fC
,
char
fD
,
char
fE
,
char
fF
){
//char f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, fA, fB, fC, fD, fE, fF;
if
(
strlen
(
a
)
>=
16
){
f0
=
a
[
0
];
f1
=
a
[
1
];
f2
=
a
[
2
];
f3
=
a
[
3
];
f4
=
a
[
4
];
f5
=
a
[
5
];
f6
=
a
[
6
];
f7
=
a
[
7
];
f8
=
a
[
8
];
f9
=
a
[
9
];
fA
=
a
[
10
];
fB
=
a
[
11
];
fC
=
a
[
12
];
fD
=
a
[
13
];
fE
=
a
[
14
];
fF
=
a
[
15
];
}
else
{
f0
=
a
[
0
];
f1
=
a
[
1
];
f2
=
a
[
3
];
f3
=
a
[
2
];
f4
=
b
[
0
];
f5
=
b
[
1
];
f6
=
b
[
3
];
f7
=
b
[
2
];
f8
=
d
[
0
];
f9
=
d
[
1
];
fA
=
d
[
3
];
fB
=
d
[
2
];
fC
=
c
[
0
];
fD
=
c
[
1
];
fE
=
c
[
3
];
fF
=
c
[
2
];
}
void
info
(
char
f0
,
char
f1
,
char
f2
,
char
f3
,
char
f4
,
char
f5
,
char
f6
,
char
f7
,
char
f8
,
char
f9
,
char
fA
,
char
fB
,
char
fC
,
char
fD
,
char
fE
,
char
fF
){
if
(
f0
==
'1'
){
printf
(
"Konstant 1 olemas
\n
"
);
...
...
@@ -397,10 +356,10 @@ void kontuur(char f0, char f1, char f2, char f3, char f4, char f5, char f6, char
if
(
implikant2
[
j
].
kood
[
1
]
==
'1'
){
uhtedeArv
++
;
}
if
(
implikant2
[
j
].
kood
[
2
]
==
'
2
'
){
if
(
implikant2
[
j
].
kood
[
2
]
==
'
1
'
){
uhtedeArv
++
;
}
if
(
implikant2
[
j
].
kood
[
3
]
==
'
3
'
){
if
(
implikant2
[
j
].
kood
[
3
]
==
'
1
'
){
uhtedeArv
++
;
}
implikant2
[
j
].
indeks
=
uhtedeArv
;
...
...
@@ -472,7 +431,46 @@ int main(void){
if
(
input
==
1
){
return
1
;
}
info
(
a
,
b
,
c
,
d
,
f0
,
f1
,
f2
,
f3
,
f4
,
f5
,
f6
,
f7
,
f8
,
f9
,
fA
,
fB
,
fC
,
fD
,
fE
,
fF
);
if
(
strlen
(
a
)
>=
16
){
f0
=
a
[
0
];
f1
=
a
[
1
];
f2
=
a
[
2
];
f3
=
a
[
3
];
f4
=
a
[
4
];
f5
=
a
[
5
];
f6
=
a
[
6
];
f7
=
a
[
7
];
f8
=
a
[
8
];
f9
=
a
[
9
];
fA
=
a
[
10
];
fB
=
a
[
11
];
fC
=
a
[
12
];
fD
=
a
[
13
];
fE
=
a
[
14
];
fF
=
a
[
15
];
}
else
{
f0
=
a
[
0
];
f1
=
a
[
1
];
f2
=
a
[
3
];
f3
=
a
[
2
];
f4
=
b
[
0
];
f5
=
b
[
1
];
f6
=
b
[
3
];
f7
=
b
[
2
];
f8
=
d
[
0
];
f9
=
d
[
1
];
fA
=
d
[
3
];
fB
=
d
[
2
];
fC
=
c
[
0
];
fD
=
c
[
1
];
fE
=
c
[
3
];
fF
=
c
[
2
];
}
info
(
f0
,
f1
,
f2
,
f3
,
f4
,
f5
,
f6
,
f7
,
f8
,
f9
,
fA
,
fB
,
fC
,
fD
,
fE
,
fF
);
kontuur
(
f0
,
f1
,
f2
,
f3
,
f4
,
f5
,
f6
,
f7
,
f8
,
f9
,
fA
,
fB
,
fC
,
fD
,
fE
,
fF
);
return
0
;
}
...
...
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