yes my code follows exactly what you said.

來源: 2010-02-13 07:02:55 [舊帖] [給我悄悄話] 本文已被閱讀:

#include

int prod[4000001];
int valid[3001];
int good[1001][1001];

int r = 3;
int p = 100;

int main()
{
int i, j, k, t;
for (i = r; i for (j = i; j prod[i * j]++;
}
}
for (i = r * 2; i valid[i] = 1;
for (j = r; j if (j > p) continue;
if (prod[j * (i - j)] }
}
for (i = r; i for (j = i; j if (!valid[i + j]) continue;
k = i * j;
good[i][j] = 1;
for (t = r; t * t if (t != i && t + k / t }
}
}
for (i = r; i for (j = i; j if (!good[i][j]) continue;
for (k = r; k t = i + j - k;
if (k > t || t > p) continue;
if (i != k && good[k][t]) break;
}
if (k > i + j) printf("%d %dn", i, j);
}
}
return 0;
}