You are on page 1of 1

#include <cmath>

#include <iostream>

using namespace std;

float a,b,c,p,k;

int main()

cout<<"Podaj bok a:";

cin >> a ;

cout << "Podaj bok b:";

cin >> b ;

cout << "Podaj bok c:";

cin >> c ;

if ( a<b+c&&a<c+b&&b<a+c&&b<c+a&&c<a+b&&c<b+a)

p = (a+b+c)/2;

k = sqrt(p*(p-a)*(p-b)*(p-c));

cout << "Pole to :"<< k << endl;

else

cout << "Liczby nie spełniają warunku istnienia trójkąta";

return 0;

You might also like