main.cpp 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. bool triangle(int a, int b, int c) {
  5. int sideA, sideB, sideC;
  6. if (a > b && a > c) {
  7. sideA = a, sideB = b, sideC = c;
  8. } else if (b > a && b > c) {
  9. sideA = b, sideB = a, sideC = c;
  10. } else {
  11. sideA = c, sideB = a, sideC = b;
  12. }
  13. if (sideB * sideB + sideC * sideC == sideA * sideA) {
  14. return true;
  15. }
  16. return false;
  17. }
  18. int main() {
  19. int n;
  20. while (cin >> n) {
  21. int a = 0, b = 0, c = 0;
  22. for (int i = 0; i < n; i++) {
  23. cin >> a >> b >> c;
  24. cout << "Scenario #" << i + 1 << ":" << endl;
  25. if (triangle(a, b, c)) {
  26. cout << "yes" << endl << endl;
  27. } else {
  28. cout << "no" << endl << endl;
  29. }
  30. }
  31. }
  32. return 0;
  33. }