fork(1) download
  1. #include <stdio.h>
  2. #include<math.h>
  3. int main(void) {
  4. // your code goes here
  5. float a,b,c,s,area;
  6. printf("Input a,b,c:");
  7. scanf("%f,%f,%f",&a,&b,&c);
  8. s=(a+b+c)/2;
  9. area=(float)sqrt(s*(s-a)*(s-b)*(s-c));
  10. printf("area=%f\n",area);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5312KB
stdin
Inputa,b,c:3,4,5
stdout
Input a,b,c:area=-nan