fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a;
  8. int b;
  9. int c;
  10. cin >> a >> b >> c ;
  11. double p = (a + b + c)/2.0;
  12. cout << sqrt(p*(p-a)*(p-b)*(p-c));
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
-nan