Commit 9716da04 by krkris

Update Kood.c

parent 58d71dc7
Showing with 43 additions and 45 deletions
...@@ -111,48 +111,7 @@ int sisestus(const char tekst[40], char a[16], char b[16], char c[16], char d[16 ...@@ -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: // 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){ 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){
//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];
}
if (f0 == '1'){ if (f0 == '1'){
printf("Konstant 1 olemas\n"); 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 ...@@ -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'){ if(implikant2[j].kood[1] == '1'){
uhtedeArv++; uhtedeArv++;
} }
if(implikant2[j].kood[2] == '2'){ if(implikant2[j].kood[2] == '1'){
uhtedeArv++; uhtedeArv++;
} }
if(implikant2[j].kood[3] == '3'){ if(implikant2[j].kood[3] == '1'){
uhtedeArv++; uhtedeArv++;
} }
implikant2[j].indeks = uhtedeArv; implikant2[j].indeks = uhtedeArv;
...@@ -472,7 +431,46 @@ int main(void){ ...@@ -472,7 +431,46 @@ int main(void){
if (input == 1){ if (input == 1){
return 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); kontuur(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, fA, fB, fC, fD, fE, fF);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment