Program trojkat.docx

(11 KB) Pobierz

Program trojkat

 

#include <iostream.h>

#include <math.h>

int main()

{

int a,b,c;

float p=0;

cout << "podaj a ";

cin >>a;

cout << "podaj b ";

cin >>b;

cout << "podaj c ";

cin >>c;

if (((a+b)>c) && ((a+c)>b) && ((b+c)>a) && (a>0) && (b>0) && (c>0))

 { p=(a+b+c) / 2.0;

   cout <<"pole = "<<sqrt(p*(p-a)*(p-b)*(p-c))<<endl; }

else cout << "to nie jest trojkat ";

system("PAUSE");

retirn 0;

}

 

 

...
Zgłoś jeśli naruszono regulamin