#include <stdio.h>
#include <math.h>
int main()
{
int a, b, c, n, flag = 0,t;
double maxN, d;
scanf("%d", &n);
maxN = sqrt(n);
t=maxN<1200?maxN:1200;
for(a = 0; a < t; a ++)
{
for(b = a; b < t; b ++)
{
for(c = b; c < t; c ++)
{
d = sqrt(n - a*a - b*b - c*c);
if(d == (int)d)
{
printf("%d %d %d %d\n", a, b, c, (int)d);
goto next;
}
}
}
}
next:;
return 0;
}
四平方和
最新推荐文章于 2024-12-17 23:24:15 发布