33 lines
582 B
C
33 lines
582 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
int num;
|
|
int i, j;
|
|
double comp;
|
|
double in;
|
|
int doublon;
|
|
printf("Combien de réel à rentrée ? ");
|
|
scanf("%d", &num);
|
|
double* tab = (double*) calloc(num, sizeof(double));
|
|
for(i=0;i<num;i++){
|
|
printf("case %d : ", i);
|
|
scanf("%lf", tab+i);
|
|
printf("\n");
|
|
}
|
|
for(i=0;i<num;i++){
|
|
doublon = 0;
|
|
comp=tab[i];
|
|
for(j=0;j<num;j++){
|
|
if((*(tab+i) == *(tab+j) && (tab+i) != (tab+j))){
|
|
doublon = 1;
|
|
}
|
|
}
|
|
if(doublon == 0){
|
|
printf("%.2lf ", comp);
|
|
}
|
|
}
|
|
printf("\n");
|
|
free(tab);
|
|
return EXIT_SUCCESS;
|
|
} |