Run ID:148138

提交时间:2026-02-09 17:26:13

#include <iostream> #include <algorithm> using namespace std; int main() { int t; cin >> t; while (t--) { long long a, b, c; cin >> a >> b >> c; // 判断直角三角形:先排序,让c为最大边 long long sides[3] = {a, b, c}; sort(sides, sides + 3); long long x = sides[0], y = sides[1], z = sides[2]; if (x * x + y * y == z * z) { cout << "good\n"; } else if (a == b || b == c || a == c) { cout << "perfect\n"; } else { cout << "just a triangle\n"; } } return 0; }