/*************************************************************************************************************************************/
/* */
/* M I S E A U P O I N T D E ' v $xrv/GestionDecimales.01$K ' : */
/* */
/* */
/* Author of '$xtc/GestionDecimales.01$c' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20200813123539). */
/* */
/*************************************************************************************************************************************/
#include <stdio.h>
#define N \
5
#define INCREMENTATION_DECIMALE \
{ \
decimale_courante++; \
if (decimale_courante > plus_grande_decimale) \
{ \
decimale_courante=plus_petite_decimale; \
} \
else \
{ \
} \
}
int main()
{
float fichier[N] = {4,4,4,5,9};
int plus_petite_decimale=0;
int plus_grande_decimale=9;
int numero_courant_etendu;
int numero_courant_etendu_a_editer;
int decimale_courante;
int index;
numero_courant_etendu=fichier[0];
decimale_courante=numero_courant_etendu;
for (index=0 ; index<N ; index++)
{
int nombre_courant=fichier[index];
if (nombre_courant == decimale_courante)
{
numero_courant_etendu_a_editer=numero_courant_etendu;
INCREMENTATION_DECIMALE;
numero_courant_etendu++;
}
else
{
while (nombre_courant != decimale_courante)
{
INCREMENTATION_DECIMALE;
numero_courant_etendu++;
}
numero_courant_etendu_a_editer=numero_courant_etendu;
INCREMENTATION_DECIMALE;
numero_courant_etendu++;
}
printf("%d\n",numero_courant_etendu_a_editer);
}
}