All pastes #396956 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2007-03-16 03:20 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 )    {       if ( x + y > z && x + z > y && y + z > x )       {          if ( a == aa || b == bb || c == cc )             cout << "This is a right triangle.\n";          else if( x != y && x != z )               cout << "This is a scalene triangle.\n";          else              cout << "This is a isosceles triangle.\n";       }    }    else          cout << "All three lengths must be entered.";    return 0;}