All pastes #396944 Raw Edit

Stuff

public cpp v1 · immutable
·published 2007-03-16 03:14 UTC
rendered paste body
#include <iostream>#include <math.h>using namespace std;int main (){    int x = 0, y = 0, z = 0;    double a, aa, b, bb, c, cc;        cout << "Enter three triangle side lengths : ";    cin  >> x;    cin  >> y;    cin  >> z;        a  = pow(x,2) + pow(y,2);    aa = pow(z,2);    b  = pow(x,2) + pow(z,2);    bb = pow(y,2);    c  = pow(y,2) + pow(z,2);    cc = pow(x,2);        if ( x != 0 && y != 0 && z != 0 )    {       cout << "\nif ( x != 0 && y != 0 && z != 0 )\n";       if ( z == ( x + y ) || x == ( z + y ) || y == ( z + x ) )       {          cout << "if ( z == ( x + y ) || x == ( z + y ) || y == ( z + x ) )\n";          if ( a == aa || b == bb || c == cc )          {             cout << "if ( a == aa || b == bb || c == cc )\n";             cout << "This is a right triangle.\n";          }          else if( x != y && x != z )          {               cout << "else if( x != y && x != z )\n";               cout << "This is a scalene triangle.\n";               }          else          {              cout << "else";              cout << "This is a isosceles triangle.\n";          }       }    }    return 0;}