Program p1; uses crt; var a,ed,des,sot,tis,s,p,max:longint; begin clrscr; writeln('введите четырех значное число'); readln(a); ed:=a mod 10; des:=a div 10 mod 10; sot:=a div 100 mod 10; tis:=a div 1000; s:=0; p:=1; p:=ed*des*sot*tis; s:=ed+des+sot+tis; writeln('Произведение чисел = ',p); writeln('Сумма чисел = ',s); if (ed>des) and (ed>sot) and (ed>tis) then max:=ed; if (des>ed) and (des>sot) and (des>tis) then max:=des; if (sot>ed) and (sot>des) and (sot>tis) then max:=sot; if (tis>ed) and (tis>des) and (tis>sot) then max:=tis; writeln('Максимальное число = ',max); readln; end.
// PascalABC.NET 3.0, сборка 1144 от 16.01.2016 type Point=record x,y:real end;
function GetPoint(c:char):Point; begin Writeln('Введите координаты точки ',c,':'); Read(Result.x,Result.y) end;
function Line(A,B:Point):real; begin Result:=sqrt(sqr(B.x-A.x)+sqr(B.y-A.y)) end;
function SqTriangle(pA,pB,pC:Point):real; begin var a:=Line(pB,pC); var b:=Line(pA,pC); var c:=Line(pA,pB); if (a+b>c) and (a+c>b) and (b+c>a) then begin var p:=(a+b+c)/2; Result:=sqrt(p*(p-a)*(p-b)*(p-c)) end else Result:=0 end;
begin var A:=GetPoint('A'); var B:=GetPoint('B'); var C:=GetPoint('C'); Writeln('Площадь треугольника равна ',SqTriangle(A,B,C)) end.
Тестовое решение: Введите координаты точки A: -5 3.18 Введите координаты точки B: 1.45 6.2 Введите координаты точки C: 6 -5.93 Площадь треугольника равна 45.98975
uses crt;
var a,ed,des,sot,tis,s,p,max:longint;
begin
clrscr;
writeln('введите четырех значное число');
readln(a);
ed:=a mod 10;
des:=a div 10 mod 10;
sot:=a div 100 mod 10;
tis:=a div 1000;
s:=0; p:=1;
p:=ed*des*sot*tis;
s:=ed+des+sot+tis;
writeln('Произведение чисел = ',p);
writeln('Сумма чисел = ',s);
if (ed>des) and (ed>sot) and (ed>tis) then max:=ed;
if (des>ed) and (des>sot) and (des>tis) then max:=des;
if (sot>ed) and (sot>des) and (sot>tis) then max:=sot;
if (tis>ed) and (tis>des) and (tis>sot) then max:=tis;
writeln('Максимальное число = ',max);
readln;
end.