fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. struct length{
  5. double a;
  6. double b;
  7. double c;
  8. };
  9.  
  10. int main(void) {
  11. struct length x={5,5,5};
  12. double t=(x.a+x.b+x.c)/2;
  13. double u=t*(t-x.a)*(t-x.b)*(t-x.c);
  14. double s;
  15. s = sqrt(u);
  16. printf("s = %lf",s);
  17.  
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5268KB
stdin
3 3 3
stdout
s = 10.825318