12345678910111213141516171819202122232425262728293031323334353637 |
- #include <iostream>
- #include <string>
- using namespace std;
- bool triangle(int a, int b, int c) {
- int sideA, sideB, sideC;
- if (a > b && a > c) {
- sideA = a, sideB = b, sideC = c;
- } else if (b > a && b > c) {
- sideA = b, sideB = a, sideC = c;
- } else {
- sideA = c, sideB = a, sideC = b;
- }
- if (sideB * sideB + sideC * sideC == sideA * sideA) {
- return true;
- }
- return false;
- }
- int main() {
- int n;
- while (cin >> n) {
- int a = 0, b = 0, c = 0;
- for (int i = 0; i < n; i++) {
- cin >> a >> b >> c;
- cout << "Scenario #" << i + 1 << ":" << endl;
- if (triangle(a, b, c)) {
- cout << "yes" << endl << endl;
- } else {
- cout << "no" << endl << endl;
- }
- }
- }
- return 0;
- }
|