1.
var x,y,sa,sg:real;
begin
write('x = '); readln(x);
write('y = '); readln(y);
sa:=(x+y)/2;
sg:=sqrt(x*y);
writeln('sa = ',sa:5:3,' sg = ',sg:5:3);
end.
Пример:
x = 5.4
y = 9.3
sa = 7.350 sg = 7.087
2.
var a,b,s,g:real;
begin
write('a = '); readln(a);
write('b = '); readln(b);
s:=(a+b)/2;
g:=sqrt(a*a+b*b);
writeln('s = ',s:5:3,' g = ',g:5:3);
end.
Пример:
a = 2.5
b = 7.1
s = 4.800 g = 7.527