fork download
  1.  
  2. #include <stdio.h>
  3. #include <math.h>
  4.  
  5. struct sannkaku{
  6.  
  7. double a;
  8. double b;
  9. double c;
  10.  
  11. };
  12.  
  13.  
  14. int main(void){
  15.  
  16. struct sannkaku t;
  17.  
  18. scanf("%lf", &t.a);
  19. scanf("%lf", &t.b);
  20. scanf("%lf", &t.c);
  21.  
  22. double s,S;
  23.  
  24. s=(t.a+t.b+t.c)/2;
  25.  
  26. S= sqrt(s*(s-t.a)*(s-t.b)*(s-t.c));
  27.  
  28. printf("a=%f",t.a);
  29. printf("b=%f",t.b);
  30. printf("c=%f",t.c);
  31. printf("S=%f",S);
  32.  
  33. return 0;
  34. }
  35.  
  36.  
  37.  
Success #stdin #stdout 0s 5320KB
stdin
5 5 5
stdout
a=5.000000b=5.000000c=5.000000S=10.825318