- 题目大意
给出三个数判断能否构成一个直角三角形。
- 解题思路
直接用勾股定理判断即可。(注意输出格式!!!)
- 代码
#includeusing namespace std;int main(){ long long n, a, b, c; cin >> n; for (int i = 0; i > a >> b >> c; cout << "Case " << i + 1 << ": "; if ((a*a +b*b==c*c) || (a * a + c * c == b * b) || (b * b + c * c == a * a)) cout << "yes" << endl; else cout << "no" << endl; } return 0;}