Как-то так var a,b,c,h,p,s:real; var ch:char; var f:boolean; begin repeat write('Êàê ñ÷èòàåì ïëîùàäü? 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); readln(ch); if ch='1' then begin write('a='); read(a); write('b='); read(b); write('c='); read(c); p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c)); writeln('Ïëîùàäü ðàâíà ',s); f:=true; end else if ch='2' then begin write('a='); read(a); write('h='); read(h); writeln('Ïëîùàäü ðàâíà ',0.5*h*a); f:=true; end else begin cls; writeln('Îòâåò ôèãîâûé! Åùå ðàçîê: 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); end; until f; end.
Как-то так var a,b,c,h,p,s:real; var ch:char; var f:boolean; begin repeat write('Êàê ñ÷èòàåì ïëîùàäü? 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); readln(ch); if ch='1' then begin write('a='); read(a); write('b='); read(b); write('c='); read(c); p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c)); writeln('Ïëîùàäü ðàâíà ',s); f:=true; end else if ch='2' then begin write('a='); read(a); write('h='); read(h); writeln('Ïëîùàäü ðàâíà ',0.5*h*a); f:=true; end else begin cls; writeln('Îòâåò ôèãîâûé! Åùå ðàçîê: 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); end; until f; end.
begin
repeat
write('Êàê ñ÷èòàåì ïëîùàäü? 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: ');
readln(ch);
if ch='1' then begin
write('a='); read(a); write('b='); read(b); write('c='); read(c);
p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Ïëîùàäü ðàâíà ',s); f:=true;
end
else if ch='2' then begin
write('a='); read(a); write('h='); read(h);
writeln('Ïëîùàäü ðàâíà ',0.5*h*a);
f:=true;
end
else begin cls; writeln('Îòâåò ôèãîâûé! Åùå ðàçîê: 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); end;
until f;
end.
begin
repeat
write('Êàê ñ÷èòàåì ïëîùàäü? 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: ');
readln(ch);
if ch='1' then begin
write('a='); read(a); write('b='); read(b); write('c='); read(c);
p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c));
writeln('Ïëîùàäü ðàâíà ',s); f:=true;
end
else if ch='2' then begin
write('a='); read(a); write('h='); read(h);
writeln('Ïëîùàäü ðàâíà ',0.5*h*a);
f:=true;
end
else begin cls; writeln('Îòâåò ôèãîâûé! Åùå ðàçîê: 1-Ïî Ãåðîíó, 2-÷åðåç ïîëîâèíó ïðîèçâåäåíèÿ îñíîâàíèÿ íà âûñîòó: '); end;
until f;
end.