题解 | 三角形判断
三角形判断
https://www.nowcoder.com/practice/689ec1e742394e09b1059556fc167b65
#include <iostream> using namespace std; int main() { int a, b, c; while (cin >> a >> b >> c) { if (a + b > c && a + c > b && c + b > a) { if (a==b&&a==c) cout << "Equilateral triangle!" << endl; if ((a == b && a != c) || (a == c && a != b) || (b == c && b != a))cout << "Isosceles triangle!" << endl; if(a!=b&&a!=c&&b!=c) cout << "Ordinary triangle!" << endl; } else cout << "Not a triangle!" << endl; } return 0; } // 64 位输出请用 printf("%lld")