fork download
  1. #include <cstdio>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double x, y, z;
  8. scanf( "%lf %lf %lf", &x, &y, &z );
  9. //if the triangle exists
  10. if( x + y + z > 2*max(x, max(y, z) ) )
  11. {
  12. //if it is acute
  13. if( ( x*x + y*y - z*z ) / ( 2*x*y ) ) printf( "The triangle is acute." );
  14. else printf( "The triangle is not acute." );
  15. }
  16. else printf( "The triangle doesn't exist." );
  17. return 0;
  18. }
Success #stdin #stdout 0s 3344KB
stdin
811	22	790
stdout
The triangle is acute.