Exemple d’utilisation de ‘int isgreater ( x , y ) et ‘int isgreaterequal ( x , y )’ pour trouver les côtés d’un triangle

Author:


Download

#include

#include 
int main()
{
/* Vérifier si a, b, et c peuvent être les 3 côtés d'un triangle*/
double a, b, c, temp;

if ( isgreater( a, b ) )
{
   temp = a;
   a = b;
   b = temp;
}
if ( isgreater( a, c ) )
   temp = a; a = c; c = temp;

if ( isgreaterequal( a, b + c ) )
  printf( "Le trois nombres %.2lf, %.2lf, et %.2lf "
   "ne sont pas les 3 côtés d'un triangle.n", a, b, c );

return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *