На каком языке надо написать? На Паскале: program geron; var a, b, c, p: Real; begin ReadLn(a, b, c); p := (a+b+c) / 2; WriteLn('S = ', sqrt(p*(p-a)*(p-b)*(p-c))); end.
На С++ #include <iostream> #include <cmath>
void main() { double a, b, c, p; std::cin >> a >> b >> c; p = (a+b+c) / 2; std::cout << "S = " << sqrt(p*(p-a)*(p-b)*(p-c)) << std::endl; }
На Паскале:
program geron;
var a, b, c, p: Real;
begin
ReadLn(a, b, c);
p := (a+b+c) / 2;
WriteLn('S = ', sqrt(p*(p-a)*(p-b)*(p-c)));
end.
На С++
#include <iostream>
#include <cmath>
void main()
{
double a, b, c, p;
std::cin >> a >> b >> c;
p = (a+b+c) / 2;
std::cout << "S = " << sqrt(p*(p-a)*(p-b)*(p-c)) << std::endl;
}