题目描述如果三个正整数A、B、C ,A² + B² = C² 则为勾股数,如果ABC之间两两互质,即A与B,A与C,B与C均互质没有公约数,则称其为勾股数元组。请求出给定 n ~ m 范围内所有的勾股数元组。输入描述起始范围1 n 输出描述ABC保证A 输出格式A B C多组勾股数元组,按照A B C升序的排序方式输出。若给定范围内,找不到勾股数元组时,输出Na。import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNextInt()) { int n = in.nextInt(); int m = in.nextInt(); boolean found = false; for (int i = n; i for (int j = i + 1; j int k = (int) Math.sqrt(i * i + j * j); if (k > m) { break; } if (k * k == i * i + j * j) { if (gcd(i, j) == 1 && gcd(j, k) == 1) { System.out.printf("%d %d %d\\n", i, j, k); found = true; } } } } if (!found) { System.out.println("Na"); } } } private static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }}