fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. struct hen{
  4. double a;
  5. double b;
  6. double c;
  7. };
  8. int main(void){
  9. double p;
  10. double s;
  11. struct hen x;
  12. scanf("%lf",&x.a);
  13. scanf("%lf",&x.b);
  14. scanf("%lf",&x.c);
  15. p=(x.a+x.b+x.c)/2;
  16. printf("a:%f\n",x.a);
  17. printf("b:%f\n",x.a);
  18. printf("c:%f\n",x.b);
  19. printf("p:%f\n",p);
  20. s = sqrt(p*(p-x.a)*(p-x.b)*(p-x.c));
  21. printf("s = %lf", s);
  22.  
  23. return 0;
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
Success #stdin #stdout 0.01s 5280KB
stdin
5 5 5
stdout
a:5.000000
b:5.000000
c:5.000000
p:7.500000
s = 10.825318