/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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
                                                  {
                                                  }
                                        }
                              }
                    }
          }



Copyright © Jean-François Colonna, 2023-2023.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2023-2023.