View Code of Problem 24

#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<iostream>
#include<stack>
#include<time.h>
using namespace std;
/*test*/
//#define as '\x41'
//int atoi(char s[]);
//int strlen(char s[]);
//void squeeze(char s[], char c);
//void strcat(char s[], char t[]);
//int bitcount(unsigned x);

int main()
{
	int a, b, c;
	float s;
	scanf("%d%d%d", &a, &b, &c);
	s =float(sqrt((a + b + c)*(a + b - c)*(a + c - b)*(b + c - a))) / 4;
	printf("%.2f", s);
}
/*
Main.cc: In function 'int main()':
Main.cc:21:11: error: 'sqrt' was not declared in this scope
  s =float(sqrt((a + b + c)*(a + b - c)*(a + c - b)*(b + c - a))) / 4;
           ^~~~
Main.cc:21:11: note: suggested alternative: 'qsort'
  s =float(sqrt((a + b + c)*(a + b - c)*(a + c - b)*(b + c - a))) / 4;
           ^~~~
           qsort
*/

Double click to view unformatted code.


Back to problem 24