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
e89d5a2d
authored
Oct 18, 2024
by
Jürgen Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
katsetus int kontrolliga Kodutoo2MassiividLiitmine.c
parent
4b993b2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
Kodutöö 2/Kodutoo2MassiividLiitmine.c
Kodutöö 2/Kodutoo2MassiividLiitmine.c
View file @
e89d5a2d
/* Ko
dutöö 2. Variant 4.
/* Ko
dutöö 2. Variant 4.
...
@@ -18,9 +18,9 @@ void CVäljastus(int, int, double[][max]);
...
@@ -18,9 +18,9 @@ void CVäljastus(int, int, double[][max]);
int
main
(
void
)
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
k
=
Sisestus
(
"Sisestage B ridade arv"
);
//read
int
k
=
Sisestus
(
"Sisestage B ridade arv"
);
//read
int
l
=
Sisestus
(
"Sisestage B veergude arv"
);
//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
];
...
@@ -39,18 +39,30 @@ int main(void)
...
@@ -39,18 +39,30 @@ int main(void)
int
Sisestus
(
char
teade
[])
int
Sisestus
(
char
teade
[])
{
{
int
arv
;
int
arv
;
int
i
;
int
Kontroll
;
int
S
[]
=
{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
};
do
do
{
{
printf
(
"%s
\n
"
,
teade
);
printf
(
"%s
\n
"
,
teade
);
scanf
(
"%d"
,
&
arv
);
scanf
(
"%d"
,
&
arv
);
if
(
arv
<=
1
||
arv
>=
10
)
Kontroll
=
0
;
{
for
(
i
=
0
;
i
<
max
;
i
++
)
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
{
}
if
(
arv
==
S
[
i
])
//Kontroll, kas väärtus on täisarv vahemikus 1...10.
}
while
(
arv
<=
1
||
arv
>=
10
);
{
Kontroll
=
1
;
//Sisestus sobib piirkonda
}
}
if
(
Kontroll
==
0
)
{
printf
(
"Sisestatud väärtus ei sobi, sisestage täisarv vahemikus 1...10."
);
}
}
while
(
Kontroll
==
0
);
return
arv
;
return
arv
;
}
}
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