Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
rallui
/
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
67bab93b
authored
Dec 05, 2017
by
rallui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
522fa840
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
0 deletions
Tunnitööd/tunnitoo14.c
Tunnitööd/tunnitoo14.c
0 → 100644
View file @
67bab93b
#include <stdio.h>
#include <stdio.h>
#define n 4
#define m 4
int
main
(
void
)
{
int
i
,
j
;
int
B
[
n
][
m
]
=
{
{
-
3
,
-
3
,
5
,
9
},
{
5
,
6
,
5
,
8
},
{
11
,
3
,
6
,
2
},
{
2
,
-
4
,
5
,
5
}
};
while
(
i
<
n
)
{
j
=
0
;
while
(
j
<
m
)
{
printf
(
"[%4d]"
,
B
[
i
][
j
]);
j
++
;
}
printf
(
"
\n
"
);
i
++
;
}
float
min
[
m
];
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
if
(
i
==
j
)
{
if
(
min
[
j
]
>
B
[
i
][
j
])
{
min
[
j
]
=
B
[
i
][
j
];
printf
(
"Minimaalne element diagonaalis:[%d][%d] = %d"
,
i
,
j
,
B
[
i
][
j
]);
}
i
=
i
+
1
;
}
}
printf
(
"
\n
"
);
}
float
max
[
m
];
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
if
(
i
==
j
)
{
if
(
max
[
j
]
<
B
[
i
][
j
])
{
max
[
j
]
=
B
[
i
][
j
];
printf
(
"Maksimaalne element diagonaalis: [%d][%d] = %d"
,
i
,
j
,
B
[
i
][
j
]);
}
i
=
m
+
1
;
}
}
printf
(
"
\n
"
);
}
float
min2
[
m
];
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
if
(
i
+
j
==
m
+
1
)
{
if
(
min2
[
j
]
>
B
[
i
][
j
])
{
min2
[
j
]
=
B
[
i
][
j
];
printf
(
"Minimaalne element diagonaalis: [%d][%d] = %d"
,
i
,
j
,
B
[
i
][
j
]);
}
i
=
m
+
1
;
}
}
printf
(
"
\n
"
);
}
float
max2
[
m
];
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
if
(
i
+
j
==
m
-
1
)
{
if
(
max2
[
j
]
<
B
[
i
][
j
])
{
max2
[
j
]
=
B
[
i
][
j
];
printf
(
"Maksimaalne element diagonaalis: [%d][%d] = %d"
,
i
,
j
,
B
[
i
][
j
]);
}
i
=
m
+
1
;
}
}
}
printf
(
"
\n
"
);
return
0
;
}
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