43 lines
704 B
C
43 lines
704 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
int main(void){
|
||
|
float* tab;
|
||
|
int i = 0;
|
||
|
int a;
|
||
|
int fin = 0;
|
||
|
int lin = 2;
|
||
|
int valeur;
|
||
|
tab = (float*) malloc(2*sizeof(float));
|
||
|
printf("Donnez une réponse : ");
|
||
|
valeur = scanf("%f", &tab[i]);
|
||
|
if(valeur == 1){
|
||
|
i++;
|
||
|
}
|
||
|
while(valeur != 1){
|
||
|
printf("Donnez une valeur : ");
|
||
|
valeur = scanf("%f", tab[i]);
|
||
|
if (valeur == 1 ){
|
||
|
i++;
|
||
|
}
|
||
|
if (i%2 == 0){
|
||
|
lin = lin +2;
|
||
|
tab = (float*) realloc(tab, lin);
|
||
|
}
|
||
|
int taille = strlen(tab);
|
||
|
}
|
||
|
for(i=0;i<taille;i++){
|
||
|
fin =0;
|
||
|
for(a=0; a<taille; a++){
|
||
|
if (tab[i] == tab[a] && a != i){
|
||
|
a==taille;
|
||
|
fin = 1;
|
||
|
}
|
||
|
}
|
||
|
if(fin == 0){
|
||
|
printf("%d ", tab[i]);
|
||
|
}
|
||
|
}
|
||
|
printf("\n");
|
||
|
return 0;
|
||
|
}
|
||
|
|