1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
//tas T;
char x, ligne[256];
int n = 0, w = 0, z = 0;
printf("Quels types de valeurs dans le tas ?\n");
printf("c pour des chaines,\nn pour des entiers.\n");
scanf("%c",&x);
while(getchar()!='\n'); // pour vider le buffer
if ( x != 'c' && x != 'n' ) {
fprintf(stderr,"Entiers ou chaines !\n");
exit(EXIT_FAILURE);
}
printf("Vous avez choisi %c\n",x);
printf("\nCombien de valeurs dans le tas ? ");
scanf("%d",&n);
while(getchar()!='\n'); // pour vider le buffer
printf("\nEntrez les %d valeurs :\n",n);
while ( w < n ) {
void* z = NULL;
if ( x == 'c' ) {
fgets(ligne,256,stdin);
//tas_inserer(T, z);
} else if ( x == 'n' ) {
scanf("%d",&z);
while(getchar()!='\n'); // pour vider le buffer
//tas_inserer(T,z);
}
w++;
}
if (argc == 1) {
//T=tas_creer(ordre_lexico_normal);
} else if (argc == 2 && argv[1] == "-i") {
//T=tas_creer(ordre_lexico_inverse);
} else if (argc == 2 && argv[1] == "-n") {
//T=tas_creer(ordre_numerique_ascendant);
} else if (argc == 3 && argv[1] == "-i" && argv[2] == "-n") {
//T=tas_creer(ordre_numerique_descendant);
} else {
//usage(argv[0]);
}
return EXIT_SUCCESS;
} |
Partager