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