Răspuns:
program sumaMinMax;
var a, b, c, d, min4, max4: integer;
begin
write(' introdu 4 numere intregi: '); read(a,b,c,d);
if (a<b) then begin min4:=a; max4:=b; end
else begin min4:=b; max4:=a; end;
if (min4>c) then min4:=c;
if (max4<c) then max4:=c;
if (min4>d) then min4:=d;
if (max4<d) then max4:=d;
writeln('minim + maxim = ', min4+max4);
end.