Developpement/23DEV1.1/TPS1/TP2/18-AllocationDynamique/Précognition.c

35 lines
608 B
C
Raw Normal View History

2024-12-09 11:53:11 +01:00
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int num = 0;
int i, j;
double comp;
double in;
int doublon;
char revoir;
double* tab = (double*) malloc(sizeof(double));
while(revoir != 'q' || revoir != 'Q'){
printf("case %d : ", num);
scanf("%lf", tab+i);
num++;
printf("quitter ? ");
scanf("%c", &revoir);
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(p);
return EXIT_SUCCESS;
}