Объяснение:
1
program Middle;
var
mid, x1,x2,x3 : integer;
begin
write('input x1, x2, x3 ');
readln(x1,x2,x3);
if x1 < x2
then if x1 < x3
then if x2 < x3
then mid := x2
else mid := x3
else mid := x1
else if x1 > x3
then mid := x3
else mid := x2
else mid := x1;
writeln ('Middle is ',mid);
end.
2
program pifagor;
Cat1, Cat2, Hyp, Space : real;
write ('Cat1, Cat2 :');
Readln (Cat1, Cat2);
Hyp := sqrt (sqr(Cat1)+sqr(Cat2));
Space := (Cat1 * Cat2)/2;
WriteLn ('By Cat1 =',Cat1:5:2,' and Cat2 = ',Cat2:5:2,' Hyp is: ',Hyp:5:2, ' Space is: ',Space:5:2);
Объяснение:
1
program Middle;
var
mid, x1,x2,x3 : integer;
begin
write('input x1, x2, x3 ');
readln(x1,x2,x3);
if x1 < x2
then if x1 < x3
then if x2 < x3
then mid := x2
else mid := x3
else mid := x1
else if x1 > x3
then if x2 < x3
then mid := x3
else mid := x2
else mid := x1;
writeln ('Middle is ',mid);
end.
2
program pifagor;
var
Cat1, Cat2, Hyp, Space : real;
begin
write ('Cat1, Cat2 :');
Readln (Cat1, Cat2);
Hyp := sqrt (sqr(Cat1)+sqr(Cat2));
Space := (Cat1 * Cat2)/2;
WriteLn ('By Cat1 =',Cat1:5:2,' and Cat2 = ',Cat2:5:2,' Hyp is: ',Hyp:5:2, ' Space is: ',Space:5:2);
end.
program numOp;
var a,b:longint;
begin
write('a='); readln(a);
write('b='); readln(b); writeln;
writeln('Среднее арифметическое: ',((a+b)/2):0:2);
writeln('Сумма: ',a+b);
writeln('Разность: ',a-b);
writeln('Произведение: ',a*b); readln;
end.
2)
program triangleInf;
var
kat1,kat2:longint;
gip,s:real;
begin
write('Катет1: '); readln(kat1);
write('Катет2: '); readln(kat2);
gip:=sqrt(sqr(kat1)+sqr(kat2)); s:=kat1*kat2/2;
writeln('Гипотенуза: ',gip:0:2);
writeln('Площадь: ',s:0:2); readln;
end.