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
3892c5f4
authored
Oct 17, 2024
by
Jürgen Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sisestus võetud kokku üheks funktsiooniks, define 10 lisatud. Kodutoo2MassiividLiitmine.c
parent
9e32c10d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
67 deletions
Kodutöö 2/Kodutoo2MassiividLiitmine.c
Kodutöö 2/Kodutoo2MassiividLiitmine.c
View file @
3892c5f4
/* Ko
dutöö 2. Variant 4.
/* Ko
dutöö 2. Variant 4.
...
@@ -6,25 +6,22 @@
...
@@ -6,25 +6,22 @@
* Massiiv C kuvatakse ridade kaupa.*/
* Massiiv C kuvatakse ridade kaupa.*/
#include <stdio.h>
#include <stdio.h>
#define max 10
//Prototüübid
//Prototüübid
int
SisestusN
();
int
Sisestus
(
char
[]);
int
SisestusM
();
int
SisestusL
();
int
SisestusK
();
int
SisestusCRida
(
int
,
int
);
int
SisestusCRida
(
int
,
int
);
int
SisestusCVeerg
(
int
,
int
);
int
SisestusCVeerg
(
int
,
int
);
void
MaatriksSisestus
(
int
,
int
,
int
,
int
,
double
[][
10
],
double
[][
10
]);
void
MaatriksSisestus
(
int
,
int
,
int
,
int
,
double
[][
max
],
double
[][
max
]);
void
V
ä
ljastusAlgne
(
int
,
int
,
int
,
int
,
double
[][
10
],
double
[][
10
]);
void
V
ä
ljastusAlgne
(
int
,
int
,
int
,
int
,
double
[][
max
],
double
[][
max
]);
void
MaatriksLiitmine
(
int
,
int
,
double
[][
10
],
double
[][
10
],
double
[][
10
]);
void
MaatriksLiitmine
(
int
,
int
,
double
[][
max
],
double
[][
max
],
double
[][
max
]);
void
CV
ä
ljastus
(
int
,
int
,
double
[][
10
]);
void
CV
ä
ljastus
(
int
,
int
,
double
[][
max
]);
int
main
(
void
)
int
main
(
void
)
{
{
int
n
=
Sisestus
N
(
);
//read
int
n
=
Sisestus
(
"Sisestage A ridade arv"
);
//read
int
m
=
Sisestus
M
(
);
//veerud
int
m
=
Sisestus
(
"Sisestage A veergude arv"
);
//veerud
int
k
=
Sisestus
K
(
);
//read
int
k
=
Sisestus
(
"Sisestage B ridade arv"
);
//read
int
l
=
Sisestus
L
(
);
//veerud
int
l
=
Sisestus
(
"Sisestage B veergude arv"
);
//veerud
double
A
[
n
][
m
];
double
A
[
n
][
m
];
double
B
[
k
][
l
];
double
B
[
k
][
l
];
int
CRida
=
SisestusCRida
(
n
,
k
);
int
CRida
=
SisestusCRida
(
n
,
k
);
...
@@ -39,67 +36,21 @@ int main(void)
...
@@ -39,67 +36,21 @@ int main(void)
}
}
//Sisestus
//Sisestus
int
SisestusN
()
int
Sisestus
(
char
teade
[])
{
int
n
;
do
{
printf
(
"Sisestage A ridade arv
\n
"
);
scanf
(
"%d"
,
&
n
);
if
(
n
<=
1
||
n
>=
10
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
n
<=
1
||
n
>=
10
);
return
n
;
}
int
SisestusM
()
{
int
m
;
do
{
printf
(
"Sisestage A veergude arv
\n
"
);
scanf
(
"%d"
,
&
m
);
if
(
m
<=
1
||
m
>=
10
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
m
<=
1
||
m
>=
10
);
return
m
;
}
int
SisestusK
()
{
{
int
k
;
int
arv
;
do
do
{
{
printf
(
"
Sisestage B ridade arv
\n
"
);
printf
(
"
%s
\n
"
,
teade
);
scanf
(
"%d"
,
&
k
);
scanf
(
"%d"
,
&
arv
);
if
(
k
<=
1
||
k
>=
10
)
if
(
arv
<=
1
||
arv
>=
10
)
{
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
}
while
(
k
<=
1
||
k
>=
10
);
}
while
(
arv
<=
1
||
arv
>=
10
);
return
k
;
return
arv
;
}
}
int
SisestusL
()
{
int
l
;
do
{
printf
(
"Sisestage B veergude arv
\n
"
);
scanf
(
"%d"
,
&
l
);
if
(
l
<=
1
||
l
>=
10
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
l
<=
1
||
l
>=
10
);
return
l
;
}
int
SisestusCRida
(
int
n
,
int
k
)
//miinimum ridade arvu leidmine
int
SisestusCRida
(
int
n
,
int
k
)
//miinimum ridade arvu leidmine
{
{
int
CRida
;
int
CRida
;
...
...
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