APL/APL1.2/Dev1.2/Structures/Singletons.c
2021-11-30 15:07:19 +01:00

33 lines
730 B
C

#include <stdlib.h>
#include <stdio.h>
int main (void) {
int entiers,i=0,j,k,NON=0;
printf("Combien d'entiers voulez-vous entrer ? :");
scanf("%d",&entiers);
int tab[entiers-1];
while (i < entiers){
printf("Entrez la valeur %d : ", i+1);
scanf("%d",&j);
for (k=0; k<=i;k++){
if (tab[k] == j ) {
NON = NON+1;
}else{
tab[i] = j;
}
}
i++;
}
for (i=0;i<entiers;i++){
printf ("+-----");
}
printf("\n");
for (i=0;i<entiers;i++){
printf ("%4d ",tab[i]);
}
printf("\n");
for (i=0;i<entiers;i++){
printf ("+-----");
}
return EXIT_SUCCESS;
}