program z2_9 uses crt var x1 y1 x2 y2 x3 y3 x4 y4 a1 b1 a2 b2 integer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
program z2_9;
uses crt;
var x1,y1,x2,y2, x3,y3,x4,y4, a1,b1, a2,b2 : integer;
begin
clrscr;
write('Vvedite koordinati levogo nijnego ugla pervoi figuri (x1,y1): ');
readln(x1,y1);
write('Vvedite koordinati levogo nijnego ugla vtoroi figuri (x2,y2): ');
readln(x2,y2);
write('Vvedite dlini storon pervoi figuri (a1,b1): ');
readln(a1,b1);
write('Vvedite dlini storon vtoroi figuri (a2,b2): ');
readln(a2,b2);
if (x1<x2) then x3 := x1 else
x3 := x2;
if (y1<y2) then y3 := y1 else
y3 := y2;
if ((x1+a1) > (x2+a2)) then x4 := x1+a1 else
x4 := x2+a2;
if ((y1+b1) > (y2+b2)) then y4 := y1+b1 else
y4 := y2+b2;
writeln('koordinati minimalnogo pryamougolnika, vkluchaushego obe figuri');
writeln('leviy nijniy ugol - x3=',x3,', y3=',y3);
writeln('praviy verhniy ugol - x4=',x4,', y4=',y4);
readln;
end.