/* 6Week Practicum Part I: Ugly solution! Actually, this is only really ugly in that it relies on some math beyond what was in the discussion, and makes the testing difficult in order to avoid having to finde the largest length. */ #include <iostream> using namespace std; int main() { // Read three lengths a, b and c char junk; int a , b , c; cin >> a >> junk >> b >> junk >> c >> junk; // check to make sure we've got a triangle otherwis determine type if (a >= b + c || b >= a + c || c >= a + b) cout << "Not a triangle" << endl; else if (a*a < b*b + c*c && b*b < a*a + c*c && c*c < a*a + b*b) cout << "Scalene triangle" << endl; else if (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b) cout << "Right triangle" << endl; else cout << "Obtuse triangle" << endl; return 0; }