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