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