/*************************************************************************************************************************************/
/* */
/* C A L C U L D E T R I P L E T S D E N O M B R E S P Y T H A G O R I C I E N S : */
/* */
/* */
/* Author of '$xtc/Pythagore.01$c' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, AAAAMMJJhhmmss). */
/* */
/*************************************************************************************************************************************/
#include <stdio.h>
#define N 20 \
/* Definition du maximum des trois nombres {a,b,c}. */
main()
{
int a,b,c;
/* Trois nombres entiers courants... */
for (a=1 ; a<=N ; a++)
{
for (b=a ; b<=N ; b++)
/* En mettant "b=a" au lieu de "b=1", on elimine les solutions "commutees"... */
{
for (c=b ; c<=N ; c++)
{
if (((a*a)+(b*b)) == (c*c))
{
printf("%d*%d + %d*%d = %d*%d\n",a,a,b,b,c,c);
}
else
{
}
}
}
}
}