fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. struct Triangle{
  5. double a;
  6. double b;
  7. double c;
  8. } triangle={5,5,5};
  9.  
  10. int main(void){
  11. double s,S;
  12. s=(triangle.a+triangle.b+triangle.c)/2;
  13. S= sqrt(s*(s-triangle.a)*(s-triangle.b)*(s-triangle.c));
  14. printf("S= %lf", S);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
S= 10.825318