diff --git a/DEV1.1/TP18/precognition b/DEV1.1/TP18/precognition index 72f0f61..1dd7d5e 100755 Binary files a/DEV1.1/TP18/precognition and b/DEV1.1/TP18/precognition differ diff --git a/DEV1.1/TP18/precognition.c b/DEV1.1/TP18/precognition.c index b2060fb..aa182ac 100644 --- a/DEV1.1/TP18/precognition.c +++ b/DEV1.1/TP18/precognition.c @@ -3,29 +3,29 @@ int main(void) { - int pris=0,val=1,val1,occ,nbr_val=0; + int pris=0,val=1,val1,occ=0,nbr_val=0; double* tab=NULL; double* tab_val=NULL; tab = (double*) malloc(sizeof(double)); printf("Réel à entrer: "); pris=scanf("%lf",tab[nbr_val]); - while(pris!=0){ + while(pris==1){ tab = (double*) realloc(tab,nbr_val*sizeof(double)); printf("Réel à entrer: "); pris=scanf("%lf",tab[nbr_val]); nbr_val++; } - tab_val = (double*) malloc(nbr_val*sizeof(double)); - printf("%3f ",tab[0]); + tab_val = (double*) malloc((nbr_val+1)*sizeof(double)); + printf("%3s ",tab[0]); tab_val[0]=tab[0]; for(val=1;val +#include +#include + + +int main(void){ + time_t times =time(NULL); + struct tm *timeI=localtime(×); + printf("La date est: %02d - %02d - %02d\n", timeI->tm_year + 1900,timeI->tm_mon, timeI->tm_mday); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP19/numero b/DEV1.1/TP19/numero new file mode 100755 index 0000000..4e7eab7 Binary files /dev/null and b/DEV1.1/TP19/numero differ diff --git a/DEV1.1/TP19/numero.c b/DEV1.1/TP19/numero.c new file mode 100644 index 0000000..bfe36d0 --- /dev/null +++ b/DEV1.1/TP19/numero.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include + + +int main(void) { + struct passwd *info=getpwnam("felix-vi"); + printf("Votre uid est %lu\n",(unsigned long) info->pw_uid); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP19/tailles b/DEV1.1/TP19/tailles new file mode 100755 index 0000000..05f6c73 Binary files /dev/null and b/DEV1.1/TP19/tailles differ diff --git a/DEV1.1/TP19/tailles.c b/DEV1.1/TP19/tailles.c new file mode 100644 index 0000000..fe0e4aa --- /dev/null +++ b/DEV1.1/TP19/tailles.c @@ -0,0 +1,14 @@ +#include +#include + +struct taille{ + char a; + char b; + char c; +}; + +typedef struct taille e; + +int main(void){ + printf("%lu\n", sizeof(e)); +} \ No newline at end of file