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