fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. struct hen{
  4. double a;
  5. double b;
  6. double c;
  7. }length;
  8. int main(void) {
  9. // your code goes here
  10. double S,s;
  11. scanf("%lf",&length.a);
  12. scanf("%lf",&length.b);
  13. scanf("%lf",&length.c);
  14.  
  15. s=(length.a+length.b+length.c)/2;
  16. printf("%lf\n",s);
  17. S=s*(s-length.a)*(s-length.b)*(s-length.c);
  18.  
  19. printf("%lf",sqrt(S));
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0.01s 5284KB
stdin
5.0 5.0 5.0
stdout
7.500000
10.825318