#include<stdio.h> #include<math.h> void main(){ int a,b,c; double h,cosA,s; scanf("%d%d%d",&a,&b,&c); cosA=(b*b+c*c-a*a)/(2.0*b*c); h=sqrt(b*b-b*cosA*b*cosA); s=0.5*c*h; printf("%.2f\n",s); }
Double click to view unformatted code.