#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
int he;
int x;
int j=0;
double b;
int c;
ofstream fout("data.txt");
for(int i=0;i<500;i++)
{
he=500-(i+1);
double y=sqrt(he);
fout <<he<<"的勾股弦数:"<<endl;
x=(int)y;
while(x*x>he/2)
{
j=he-x*x;
b=sqrt(j);
c=(int)b;
if(b-c==0&&x>b||c==0)
fout <<x<<","<<c<< endl;
x--;
}
}
return 0;
}