/*************************************************************************************************************************************/
/* */
/* C A L C U L D E S P R E M I E R E S D E C I M A L E S D ' U N N O M B R E */
/* D U T Y P E " N O M B R E D E C H A M P E R N O W N E " : */
/* */
/* */
/* Author of '$xtc/Champernowne.11$c' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20240911174859). */
/* */
/*************************************************************************************************************************************/
#include <stdio.h>
#include "INCLUDES.01.I"
extern int atoi();
extern double atof();
extern double sin();
#define NOMBRE 50
#define FACTEUR1 8
#define FACTEUR2 (PI/10)
#define FORMAT "%x"
/* A priori, format hexadecimal, mais "%d" peut etre aussi utilise... */
#define ESPACE FAUX
void main(int argc,char *argv[])
{
int nombre=NOMBRE;
double facteur1=FACTEUR1;
double facteur2=FACTEUR2;
if (argc >= 2)
{
nombre=atoi(argv[1]);
if (argc >= 3)
{
facteur1=atof(argv[2]);
if (argc >= 4)
{
facteur2=atof(argv[3]);
if (argc >= 5)
{
printf("Les arguments en sur-nombre sont ignores.\n");
}
else
{
}
}
else
{
}
}
else
{
}
}
else
{
}
{
int n1;
printf("0.\n");
for (n1=0 ; n1<nombre ; n1++)
{
int n2;
for (n2=0 ; n2<=(int)(facteur1*ABSO(sin(facteur2*((double)n1)))) ; n2++)
{
printf(FORMAT,n1);
if (ESPACE == VRAI)
{
printf(" ");
}
else
{
}
}
printf("\n");
}
}
printf("\n");
}