fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. struct Triangle {
  4. double a;
  5. double b;
  6. double c;
  7. };
  8.  
  9. int main(void) {
  10. struct Triangle t;
  11. double s;
  12. double area;
  13. scanf("%lf", &t.a);
  14. scanf("%lf", &t.b);
  15. scanf("%lf", &t.c);
  16. s = (t.a + t.b + t.c) / 2.0;
  17. area = sqrt(s * (s - t.a) * (s - t.b) * (s - t.c));
  18. printf("a : %.0f\n", t.a);
  19. printf("b : %.0f\n", t.b);
  20. printf("c : %.0f\n", t.c);
  21. printf("三角形の面積 : %f\n", area);
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
a : 0
b : 0
c : 0
三角形の面積 : 0.000000