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