czy moze ktos mi to sprawdzic czy to jest dobry algorytm na Herona ??
program trojkat;
uses Crt;
var
a, b, c, pole: Real;
begin
WriteLn('Podaj po kolei a b c ');
ReadLn(a, b, c);
writeln('Podaj a');
readln(a);
writeln('Podaj b');
readln(b);
writeln('Podaj c');
readln(c);
p := (a + b + c)/2;
pole := sqrt(p*(p - a)*(p - b)*(p - c));
WriteLn('Pole trojkata o bokach a=', a:0:2,', b=', b:0:2,', c=', c:0:2,' wynosi p=', pole:0:2);
end;
ReadLn;
repeat until keypressed;
end.
program trojkat;
uses Crt;
var
a, b, c, pole: Real;
begin
WriteLn('Podaj po kolei a b c ');
ReadLn(a, b, c);
writeln('Podaj a');
readln(a);
writeln('Podaj b');
readln(b);
writeln('Podaj c');
readln(c);
p := (a + b + c)/2;
pole := sqrt(p*(p - a)*(p - b)*(p - c));
WriteLn('Pole trojkata o bokach a=', a:0:2,', b=', b:0:2,', c=', c:0:2,' wynosi p=', pole:0:2);
end;
ReadLn;
repeat until keypressed;
end.