Предмет: Информатика, автор: DarkSeeL

Сформировать целочисленную матрицу 3х4. Найти максимальный элемент в каждой строке матрицы и выбрать наибольший из них. Код в паскале.

Ответы

Автор ответа: mefody66
0
PROGRAM MatrixMax
var a : array [1..3, 1..4] of integer
b : array [1..3] of integer
Max, i, j : integer
BEGIN
crt;
for i:=1 to 3 do 
begin
for j:=1 to 4 do
begin
read (a[i, j]); // вводим элементы в массив a[1..3, 1..4]
end;
writeln; // делаем пустой перевод строки
end;
for i:=1 to 3 do 
begin
b[i] := a[i, 1];
for j:=1 to 4 do
begin
if a[i, j] > b[i] then b[i] := a[i, j];
// находим максимальный элемент в каждой строке и записываем в b[1..3]
end;
end;
Max := b[1];
for i:=1 to 3 do if b[i] > Max then Max := b[i];
// Находим максимальный элемент из максимальных элементов
writeln (Max); // Выводим его на экран
END.
Похожие вопросы
Предмет: Английский язык, автор: saitvtor
Choose the correct answer
already/yet/just
a) My mother has already / yet made a cake.
b) I have just / already finished my homework. So I'm very tired.
c) She hasn't cleaned the room already / yet.
d) We have already / yet fed the dog. He is full.
e) My father has just /yet gone to work.
f) Serkan hasn't started the project just / yet.

2 Rewrite the sentences with given words.
a) We haven't climbed the Mount Everest.
Yet………………………………….
b) Su and Can have eaten three bananas.
Just……………………………………
c) My little cat has climbed the tree.
Just……………………………………
d) I have prepared the meal.
Already………………………….
e) Have they dressed up for the party?
Yet…………………………
f) Uncle Kerem has repaired the chair.
Already……………………….

3 Fill in the blanks with JUST-ALREADY-YET.
a) I've …. washed the dishes. My hands are wet.
b) My mother hasn't cooked the meal ….
c) Ishak has …. painted the fences. He is tired now.
d) Canan has …. done her homework. She never waits the deadline.
e) Our teacher hasn't come to school ….
f) Has the gardener watered the flowers ….
g) My grandfather has …. bought me a kite. But he gave it to me today.

4 Choose the correct one: JUST or ALREADY
a) We have already / just cut the trees. Everywhere is full of trees now.
b) Kübra has already / just posted the letters. Now she is at home.
c) They have already / just cleaned the kitchen. Because, they are afraid of their mothers.
d) She has already / just taken a shower. So her hair is wet.
e) Çigdem has already / just given the book to me. I read most of it.
f) Sevgi has already / just drunk a cup of coffee. So she doesn't want to drink anything now.

5 Answer the questions by using the words given in the brackets.
a) Have you washed your hair yet? (+), (already)
…………………………………..
b) Have they decided to go on holiday this summer? (+), (just)
…………………………………..
c) Has she made her presentation? (-), (yet)
…………………………………
d) Have the workers finished their work? (+), (already).
………………………………………………………….
Предмет: Математика, автор: Игорь200420