Ответы
Ответ дал:
0
program MaxProductSquare;
var
a, b, c, max1, max2, product, square: Integer;
begin
// Ввод трех чисел
WriteLn('Введите три числа:');
ReadLn(a);
ReadLn(b);
ReadLn(c);
// Находим два максимальных числа
if (a >= b) and (a >= c) then
begin
max1 := a;
if b >= c then
max2 := b
else
max2 := c;
end
else if (b >= a) and (b >= c) then
begin
max1 := b;
if a >= c then
max2 := a
else
max2 := c;
end
else
begin
max1 := c;
if a >= b then
max2 := a
else
max2 := b;
end;
// Находим произведение и его квадрат
product := max1 * max2;
square := product * product;
// Выводим результат
WriteLn('Квадрат произведения двух максимальных чисел: ', square);
end.
var
a, b, c, max1, max2, product, square: Integer;
begin
// Ввод трех чисел
WriteLn('Введите три числа:');
ReadLn(a);
ReadLn(b);
ReadLn(c);
// Находим два максимальных числа
if (a >= b) and (a >= c) then
begin
max1 := a;
if b >= c then
max2 := b
else
max2 := c;
end
else if (b >= a) and (b >= c) then
begin
max1 := b;
if a >= c then
max2 := a
else
max2 := c;
end
else
begin
max1 := c;
if a >= b then
max2 := a
else
max2 := b;
end;
// Находим произведение и его квадрат
product := max1 * max2;
square := product * product;
// Выводим результат
WriteLn('Квадрат произведения двух максимальных чисел: ', square);
end.
Вас заинтересует
1 год назад
1 год назад
1 год назад
1 год назад
3 года назад
3 года назад
8 лет назад
8 лет назад