diff --git a/DEV.1.1/Allocation_dynamique/1.Singletons b/DEV.1.1/Allocation_dynamique/1.Singletons new file mode 100755 index 0000000..e03b85b Binary files /dev/null and b/DEV.1.1/Allocation_dynamique/1.Singletons differ diff --git a/DEV.1.1/Allocation_dynamique/2.Palindromes b/DEV.1.1/Allocation_dynamique/2.Palindromes new file mode 100755 index 0000000..f004755 Binary files /dev/null and b/DEV.1.1/Allocation_dynamique/2.Palindromes differ diff --git a/DEV.1.1/Fichiers/ecriture-fichier/fprintf.c b/DEV.1.1/Fichiers/ecriture-fichier/fprintf.c new file mode 100644 index 0000000..eb2da9a --- /dev/null +++ b/DEV.1.1/Fichiers/ecriture-fichier/fprintf.c @@ -0,0 +1,17 @@ +#include +#include + +/*fprintf(, , ...) : écrit du texte formaté*/ +int main(void){ + FILE *fic = fopen("text.txt", "w"); + char mot[]="Bonjour"; + int age=18; + + if(fic==NULL) + {exit(1);} + + fprintf(fic, "J'ai %d ans %s", age, mot); + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/ecriture-fichier/fputc.c b/DEV.1.1/Fichiers/ecriture-fichier/fputc.c new file mode 100644 index 0000000..5ed2684 --- /dev/null +++ b/DEV.1.1/Fichiers/ecriture-fichier/fputc.c @@ -0,0 +1,15 @@ +#include +#include + +/*fputc(, ) : écrit un caractère*/ +int main(void){ + FILE *fic = fopen("text.txt", "w"); + + if(fic==NULL) + {exit(1);} + fputc('J',fic); + fputc('O',fic); + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/ecriture-fichier/fputs.c b/DEV.1.1/Fichiers/ecriture-fichier/fputs.c new file mode 100644 index 0000000..ebccd9f --- /dev/null +++ b/DEV.1.1/Fichiers/ecriture-fichier/fputs.c @@ -0,0 +1,16 @@ +#include +#include + +/*fputs(, ) : écrit une chaîne de caractère*/ +int main(void){ + FILE *fic = fopen("text.txt", "w"); + char mot[]="Bonjour"; + + if(fic==NULL) + {exit(1);} + + fputs(mot,fic); + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/ecriture-fichier/text.txt b/DEV.1.1/Fichiers/ecriture-fichier/text.txt new file mode 100644 index 0000000..da8278c --- /dev/null +++ b/DEV.1.1/Fichiers/ecriture-fichier/text.txt @@ -0,0 +1 @@ +J'ai 18 ans Bonjour \ No newline at end of file diff --git a/DEV.1.1/Fichiers/lecture-ficher/openfile-fgetc.c b/DEV.1.1/Fichiers/lecture-ficher/openfile-fgetc.c new file mode 100644 index 0000000..52e17ab --- /dev/null +++ b/DEV.1.1/Fichiers/lecture-ficher/openfile-fgetc.c @@ -0,0 +1,21 @@ +#include +#include + +int main(void){ + FILE *fic = fopen("text.txt", "r"); + int lettre = 0; + + if(fic == NULL){ + exit(1); + } + + while((lettre = fgetc(fic)) != EOF){ + printf("%c", lettre); + } + + printf("\n"); + + fclose(fic); + + return 0; +} diff --git a/DEV.1.1/Fichiers/lecture-ficher/openfile-fgets.c b/DEV.1.1/Fichiers/lecture-ficher/openfile-fgets.c new file mode 100644 index 0000000..d990358 --- /dev/null +++ b/DEV.1.1/Fichiers/lecture-ficher/openfile-fgets.c @@ -0,0 +1,21 @@ +#include +#include + +int main(void){ + FILE *fic = fopen("text.txt", "r"); + char lettre[256]; + + if(fic == NULL){ + exit(1); + } + + while(fgets(lettre, 255, fic) != NULL){ + printf("%s", lettre); + } + + printf("\n"); + + fclose(fic); + + return 0; +} diff --git a/DEV.1.1/Fichiers/lecture-ficher/openfile-fscanf.c b/DEV.1.1/Fichiers/lecture-ficher/openfile-fscanf.c new file mode 100644 index 0000000..6050ef0 --- /dev/null +++ b/DEV.1.1/Fichiers/lecture-ficher/openfile-fscanf.c @@ -0,0 +1,23 @@ +#include +#include + +int main(void){ + FILE *fic = fopen("text.txt", "r"); + char texte[256]; + int age = 0; + int Nombre = 0; + + if(fic == NULL){ + exit(1); + } + + fscanf(fic, "%s %d %d", texte, &age, &Nombre); + printf("Nom : %s\n", texte); + printf("Age : %d\n", age); + + printf("\n"); + + fclose(fic); + + return 0; +} diff --git a/DEV.1.1/Fichiers/lecture-ficher/text.txt b/DEV.1.1/Fichiers/lecture-ficher/text.txt new file mode 100644 index 0000000..3ab3649 --- /dev/null +++ b/DEV.1.1/Fichiers/lecture-ficher/text.txt @@ -0,0 +1,2 @@ +Emmanuel 18 1000 +Toto 47 365 \ No newline at end of file diff --git a/DEV.1.1/Fichiers/positionnement-fichier/fseek.c b/DEV.1.1/Fichiers/positionnement-fichier/fseek.c new file mode 100644 index 0000000..55b81bd --- /dev/null +++ b/DEV.1.1/Fichiers/positionnement-fichier/fseek.c @@ -0,0 +1,24 @@ +#include +#include + +/*fseek(, , ) : déplace curseur + -> : SEEK_SET (début du fichier) + SEEK_CUR (position courante) + SEEK_END (fin du fichier) +*/ +int main(void){ + FILE *fic = fopen("text.txt", "r"); + + if(fic==NULL) + {exit(1);} + + printf("Position : %d\n", ftell(fic)); + + fseek(fic,5,SEEK_SET); + + printf("Position : %d\n", ftell(fic)); + + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/positionnement-fichier/ftell.c b/DEV.1.1/Fichiers/positionnement-fichier/ftell.c new file mode 100644 index 0000000..36f502d --- /dev/null +++ b/DEV.1.1/Fichiers/positionnement-fichier/ftell.c @@ -0,0 +1,17 @@ +#include +#include + +/*ftell() : retourne la position du curseur dans le fichier +*/ +int main(void){ + FILE *fic = fopen("text.txt", "r"); + int position_cur = -1; + + if(fic==NULL) + {exit(1);} + + printf("Position %d\n", ftell(fic)); + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/positionnement-fichier/rewind.c b/DEV.1.1/Fichiers/positionnement-fichier/rewind.c new file mode 100644 index 0000000..f1a0598 --- /dev/null +++ b/DEV.1.1/Fichiers/positionnement-fichier/rewind.c @@ -0,0 +1,24 @@ +#include +#include + +/*rewind() : réinitialise la position du curseur +*/ +int main(void){ + FILE *fic = fopen("text.txt", "r"); + int position_cur = -1; + if(fic==NULL) + {exit(1);} + + printf("Position : %d\n", ftell(fic)); + + fseek(fic,5,SEEK_SET); + + printf("Position : %d\n", ftell(fic)); + + rewind(fic); + + printf("Position : %d\n", ftell(fic)); + + fclose(fic); + +} \ No newline at end of file diff --git a/DEV.1.1/Fichiers/positionnement-fichier/text.txt b/DEV.1.1/Fichiers/positionnement-fichier/text.txt new file mode 100644 index 0000000..fdb4afe --- /dev/null +++ b/DEV.1.1/Fichiers/positionnement-fichier/text.txt @@ -0,0 +1 @@ +Foul tarnished, in search of the Elden ring \ No newline at end of file diff --git a/DEV.1.2/tp2/ex4.html b/DEV.1.2/tp2/ex4.html new file mode 100644 index 0000000..82ea8cc --- /dev/null +++ b/DEV.1.2/tp2/ex4.html @@ -0,0 +1,57 @@ + + + + + + + + + + + Exercice 2 + + +

Emoticons

+ +

+ Emoticons are textual portrayals of a writer's moods or facial + expressions in the form of icons. Originally, these icons + consisted of ASCII art. +

+ +

+ Emoticons can generally be divided into two groups: Western (mainly + from America and Europe) or horizontal; Eastern or vertical (mainly + from east Asia). +

+ +

Western

+ +

+ Western style emoticons are mostly written from left to right as + though the head is rotated counter-clockwise 90 degrees. +

+ +
    +
  • Smiley: :-) :->
  • +
  • Tongue-tied: :-&
  • +
  • Broken heart: <\3
  • +
  • Rose: @}->--
  • +
  • Fish: ><(((*>
  • +
+ +

Eastern

+ +

+ Eastern emoticons generally are not rotated sideways. They first + arose in Japan, where they are referred to as kaomoji. +

+ +
    +
  • Troubled: (>_<)
  • +
  • Sad: ("_")
  • +
  • Cat: (=^·^=)
  • +
  • Headphones: ((d[-_-]b))
  • +
+ + diff --git a/DEV.1.2/tp2/ex5.html b/DEV.1.2/tp2/ex5.html new file mode 100644 index 0000000..284bc3c --- /dev/null +++ b/DEV.1.2/tp2/ex5.html @@ -0,0 +1,52 @@ + + + + + + + + + + Exercice 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Orbites des planètes du Système solaire
PlanèteDistance moyenne (UA)Exentricité Inclinaison  (°)Période de révolution (an)Photo
Mercure0,387098930,20570,241Mercure
Venus0,723331990,0073,40,615Venus
Terre10,01701Terre
Mars1,523662310,0941,91,881Mars
Jupiter5,203363010,0491,311,862Jupiter
Saturne9,60,0572,529,452Saturne
Uranus2872,50,897,830,589Uranus
Neptune4495,11,828,359,8Neptune
+ + diff --git a/DEV.1.2/tp2/style_ex4.css b/DEV.1.2/tp2/style_ex4.css new file mode 100644 index 0000000..59b1121 --- /dev/null +++ b/DEV.1.2/tp2/style_ex4.css @@ -0,0 +1,20 @@ +body { + font-family:sans-serif; +} + +h1 { + font-variant:small-caps; + text-decoration : underline; +} + +h2 { + background-color:#aaaaaa; + padding : 10px; + font-style:italic; +} + +span { + font-family: monospace; + font-weight:bold; + color : #aa4512; +} \ No newline at end of file diff --git a/DEV.1.2/tp2/style_ex5.css b/DEV.1.2/tp2/style_ex5.css new file mode 100644 index 0000000..34c07f5 --- /dev/null +++ b/DEV.1.2/tp2/style_ex5.css @@ -0,0 +1,26 @@ +table { + font-family: sans-serif; + border-collapse: collapse; + margin : auto; + width:700px; +} +table caption { + + font-weight: bold; + font-variant: small-caps; + +} + +th { + border-bottom: 3px solid black; + border-top: 3px solid black; + text-align: left; + font-weight: bold; + font-variant: small-caps; +} + +td { + border-bottom: 1px solid lightgray; + text-align: left; +} +