procedure Per(a,b,h:real;var p:real);var c,d:real;begind:=abs(a-b)/2;c:=sqrt(h*h+d*d);p:=2*c+a+b;end;var a1,b1,h1,a2,b2,h2,p1,p2,s:real;beginclrscr;writeln('Parametri 1:');write('1 osnovanie=');readln(a1);write('2 osnovanie=');readln(b1);write('h=');readln(h1);Per(a1,b1,h1,p1);writeln('Parametri 2:');write('1 osnovanie=');readln(a2);write('2 osnovanie=');readln(b2);write('h=');readln(h2);Per(a2,b2,h2,p2);s:=p1+p2;write('Summa=',s:0:2);end.
procedure Per(a,b,h:real;var p:real);
var c,d:real;
begin
d:=abs(a-b)/2;
c:=sqrt(h*h+d*d);
p:=2*c+a+b;
end;
var a1,b1,h1,a2,b2,h2,p1,p2,s:real;
begin
clrscr;
writeln('Parametri 1:');
write('1 osnovanie=');
readln(a1);
write('2 osnovanie=');
readln(b1);
write('h=');
readln(h1);
Per(a1,b1,h1,p1);
writeln('Parametri 2:');
write('1 osnovanie=');
readln(a2);
write('2 osnovanie=');
readln(b2);
write('h=');
readln(h2);
Per(a2,b2,h2,p2);
s:=p1+p2;
write('Summa=',s:0:2);
end.