View Code of Problem 24

#include<bits/stdc++.h>
using namespace std;

int main(void)
{
  double cosA,sinA,a,b,c,S;
  while(cin>>a>>b>>c)
  {
    cosA=(b*b+c*c-a*a)/(2*b*c);
    sinA=sqrt(1-cosA*cosA);
    S=b*c*sinA/2.0;
    printf("%.2lf\n",S);
  }
}

Double click to view unformatted code.


Back to problem 24