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