View Code of Problem 24

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int main()
{
	double x, y, z;
	cin >> x >> y >> z;
	double p = (x + y + z) / 2;
	double s = sqrt(p*(p - x)*(p - y)*(p - z));
	cout << fixed << setprecision(2) << s;
}
/*
Main.cc: In function 'int main()':
Main.cc:13:13: error: 'sqrt' was not declared in this scope
  double s = sqrt(p*(p - x)*(p - y)*(p - z));
             ^~~~
Main.cc:13:13: note: suggested alternative: 'qsort'
  double s = sqrt(p*(p - x)*(p - y)*(p - z));
             ^~~~
             qsort
*/

Double click to view unformatted code.


Back to problem 24