私がやっていることを理解しているだけです。「x」の最大境界を設定してから、原始的なピタゴラスのトリプルをすべてリストしています。gcd 行と if ステートメント行でもエラーが発生します。どんなガイダンスも完全に役立ちます、ありがとう。
#include <stdio.h>
int main (){
int x,y,z;
int a,b,c;
int max;
//Get user input
printf("What is the maximum bound on x?\n");
scanf("%d", &max);
y = 1;
while (y < x) {
while (x <= max) {
if ((x%2 == 1 || y%2 == 1) && gcd(x, y) == 1) {
return x;
}
else {
a = (x*x)-(y*y);
b = 2*x*y;
c = (x*x)+(y*y);
}
printf("(%d, %d, %d)\n", a, b, c);
x++;
y++;
}
}
return 0;
}