33 lines
730 B
C
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;
|
|
} |