Даны действительные положительные числа x,y,z.Получить S= сумму максимального и минимального из данных чисел — Pascal(Паскаль)

uses crt;
var x, y, z, max, min:integer;
begin
  readln(x);   readln(y);   readln(z);
  if (x > y) and (x > z) then max : = x;
  if (y > x) and (y > z) then max : = y;
  if (z > x) and (z > y) then max : = z;
  if (x < y) and (x < z) then min : = x;
  if (y < x) and (y < z) then min : = y;
  if (z < x) and (z < y) then min : = z;
  writeln(min+max);
end.

Leave a Comment

+ 61 = 65