fork download
  1. #include <bits/stdc++.h>
  2.  
  3. int main(){
  4. double a,b,c;
  5. scanf("%lf %lf %lf",&a,&b,&c);
  6. double p=(a+b+c)/2;
  7. double area=sqrt(p*(p-a)*(p-b)*(p-c));
  8. printf("%lf",area);
  9. }
Success #stdin #stdout 0.01s 5296KB
stdin
3 4 5
stdout
6.000000