Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jürgen Hein
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
013b884b
authored
Oct 16, 2024
by
Jürgen Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Kodutoo2MassiividLiitmine.c
parent
24029f46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
Kodutöö 2/Kodutoo2MassiividLiitmine.c
Kodutöö 2/Kodutoo2MassiividLiitmine.c
View file @
013b884b
/* Ko
dutöö 2. Variant 4.
/* Ko
dutöö 2. Variant 4.
...
...
@@ -21,10 +21,10 @@ void CVäljastus(int, int, double[][10]);
int
main
(
void
)
{
int
n
=
SisestusN
();
int
m
=
SisestusM
();
int
l
=
SisestusL
();
int
k
=
SisestusK
();
int
n
=
SisestusN
();
//read
int
m
=
SisestusM
();
//veerud
int
k
=
SisestusK
();
//read
int
l
=
SisestusL
();
//veerud
double
A
[
n
][
m
];
double
B
[
k
][
l
];
int
CRida
=
SisestusCRida
(
n
,
k
);
...
...
@@ -44,7 +44,7 @@ int SisestusN()
int
n
;
do
{
printf
(
"Sisestage A
veergu
de arv
\n
"
);
printf
(
"Sisestage A
rida
de arv
\n
"
);
scanf
(
"%d"
,
&
n
);
if
(
n
<=
1
||
n
>=
10
)
{
...
...
@@ -59,7 +59,7 @@ int SisestusM()
int
m
;
do
{
printf
(
"Sisestage A
rida
de arv
\n
"
);
printf
(
"Sisestage A
veergu
de arv
\n
"
);
scanf
(
"%d"
,
&
m
);
if
(
m
<=
1
||
m
>=
10
)
{
...
...
@@ -69,38 +69,38 @@ int SisestusM()
return
m
;
}
int
Sisestus
L
()
int
Sisestus
K
()
{
int
l
;
int
k
;
do
{
printf
(
"Sisestage B
veergu
de arv
\n
"
);
scanf
(
"%d"
,
&
l
);
if
(
l
<=
1
||
l
>=
10
)
printf
(
"Sisestage B
rida
de arv
\n
"
);
scanf
(
"%d"
,
&
k
);
if
(
k
<=
1
||
k
>=
10
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
l
<=
1
||
l
>=
10
);
return
l
;
}
while
(
k
<=
1
||
k
>=
10
);
return
k
;
}
int
Sisestus
K
()
int
Sisestus
L
()
{
int
k
;
int
l
;
do
{
printf
(
"Sisestage B
rida
de arv
\n
"
);
scanf
(
"%d"
,
&
k
);
if
(
k
<=
1
||
k
>=
10
)
printf
(
"Sisestage B
veergu
de arv
\n
"
);
scanf
(
"%d"
,
&
l
);
if
(
l
<=
1
||
l
>=
10
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
k
<=
1
||
k
>=
10
);
return
k
;
}
while
(
l
<=
1
||
l
>=
10
);
return
l
;
}
int
SisestusCRida
(
int
n
,
int
k
)
int
SisestusCRida
(
int
n
,
int
k
)
//miinimum ridade arvu leidmine
{
int
CRida
;
if
(
n
<
k
)
...
...
@@ -112,7 +112,7 @@ int SisestusCRida(int n, int k)
}
return
CRida
;
}
int
SisestusCVeerg
(
int
m
,
int
l
)
int
SisestusCVeerg
(
int
m
,
int
l
)
//miinimum veergude arvu leidmine
{
int
CVeerg
;
if
(
m
<
l
)
...
...
@@ -128,9 +128,9 @@ int SisestusCVeerg(int m, int l)
void
MaatriksSisestus
(
int
n
,
int
m
,
int
k
,
int
l
,
double
A
[][
m
],
double
B
[][
l
])
{
int
i
,
j
,
Kontroll
;
//järjenumbrid, scanf kontrolli muutuja
for
(
i
=
0
;
i
<
m
;
i
++
)
for
(
i
=
0
;
i
<
m
;
i
++
)
//veergude tsükkel
{
for
(
j
=
0
;
j
<
n
;
j
++
)
for
(
j
=
0
;
j
<
n
;
j
++
)
//ridade tsükkel
{
do
{
...
...
@@ -144,9 +144,9 @@ void MaatriksSisestus(int n, int m, int k, int l, double A[][m], double B[][l])
}
while
(
Kontroll
==
0
);
//reaalarvu kontroll
}
}
for
(
i
=
0
;
i
<
k
;
i
++
)
for
(
i
=
0
;
i
<
l
;
i
++
)
//veergude tsükkel
{
for
(
j
=
0
;
j
<
l
;
j
++
)
for
(
j
=
0
;
j
<
k
;
j
++
)
//ridade tsükkel
{
do
{
...
...
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