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