document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // re4(7).cpp
  2. /* this program calculates the area of a triangle, using heron\'s formula */
  3. #include<iostream>
  4. #include<stdio.h>
  5. #include<conio.h>
  6. #include<math.h>
  7. inline int tricon (float de,float dr,float dt)
  8.     {
  9.     if ( (de+dr>dt) && (dr+dt>de) && (de+dt>dr) )
  10.         {return 25;}
  11.     else {}
  12.     return 0;
  13.     }
  14. inline float triare (float se,float sr,float st)
  15.     {
  16.     int ss=(se+sr+st)/2;
  17.     int ree=0;
  18.     ree=sqrt((ss-se)*(ss-sr)*(ss-st));
  19.     return ree;}
  20.  
  21. using namespace std;
  22.  
  23. int main()
  24. {
  25.     float s1,s2,s3;
  26.     puts(" please enter the sides of the triangle\\n ");
  27.     cin>>s1>>s2>>s3;
  28.     if (tricon(s1,s2,s3)==25)
  29.         {cout<< triare(s1,s2,s3);}
  30.     else {cout<< " this is not a proper triangle ";}
  31. }
');