Commit fcc255ea by Jürgen Hein

tähised Kodutoo2MassiividLiitmine.c

parent d77a770a
Showing with 7 additions and 7 deletions
/* Kodutöö 2. Variant 4. /* Kodutöö 2. Variant 4.
...@@ -19,12 +19,12 @@ int main(void) ...@@ -19,12 +19,12 @@ int main(void)
{ {
int n = Sisestus("Sisestage A ridade arv"); //read int n = Sisestus("Sisestage A ridade arv"); //read
int m = Sisestus("Sisestage A veergude arv"); //veerud int m = Sisestus("Sisestage A veergude arv"); //veerud
int l = Sisestus("Sisestage B ridade arv"); //read int k = Sisestus("Sisestage B ridade arv"); //read
int k = Sisestus("Sisestage B veergude arv"); //veerud int l = Sisestus("Sisestage B veergude arv"); //veerud
double A[max][max]; double A[max][max];
double B[max][max]; double B[max][max];
int CRida = SisestusRidaVeerg(n, l); int CRida = SisestusRidaVeerg(n, k);
int CVeerg = SisestusRidaVeerg(m, k); int CVeerg = SisestusRidaVeerg(m, l);
double C[max][max]; double C[max][max];
MaatriksSisestus(n, m, A); MaatriksSisestus(n, m, A);
...@@ -98,9 +98,9 @@ void VäljastusAlgne(int n, int m, int k, int l, double A[][max], double B[][max ...@@ -98,9 +98,9 @@ void VäljastusAlgne(int n, int m, int k, int l, double A[][max], double B[][max
} }
printf("\nSisestatud maatriks B:\n"); printf("\nSisestatud maatriks B:\n");
for(i = 0; i < k; i++) for(i = 0; i < l; i++)
{ {
for(j = 0; j < l; j++) for(j = 0; j < k; j++)
{ {
printf("%lf ", B[i][j]); printf("%lf ", B[i][j]);
} }
......
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