diff --git a/BUT1/CONTROLE/CM1/.vscode/c_cpp_properties.json b/BUT1/CONTROLE/CM1/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..c2098a2 --- /dev/null +++ b/BUT1/CONTROLE/CM1/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "linux-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "linux-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/.vscode/launch.json b/BUT1/CONTROLE/CM1/.vscode/launch.json new file mode 100644 index 0000000..f397f36 --- /dev/null +++ b/BUT1/CONTROLE/CM1/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": false, + "cwd": "/export/home/an23/stiti/Desktop/DEV/CM1", + "program": "/export/home/an23/stiti/Desktop/DEV/CM1/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/.vscode/settings.json b/BUT1/CONTROLE/CM1/.vscode/settings.json new file mode 100644 index 0000000..bfd7745 --- /dev/null +++ b/BUT1/CONTROLE/CM1/.vscode/settings.json @@ -0,0 +1,37 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wconversion", + "-Wnull-dereference", + "-Wsign-conversion" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/exo1.c b/BUT1/CONTROLE/CM1/exo1.c new file mode 100644 index 0000000..8684f4c --- /dev/null +++ b/BUT1/CONTROLE/CM1/exo1.c @@ -0,0 +1,10 @@ +#include +#include + +int main(void){ + printf(" {o,o}\n"); + printf(" (__(\\\n");/* On rajoute un "\" pour préciser que le \ d'avant ne sert pas à dire que le caractère d'après est spécial"*/ + printf(" -\"-\"- "); /*idem ici avec les guillemets*/ + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/exo2.c b/BUT1/CONTROLE/CM1/exo2.c new file mode 100644 index 0000000..deff191 --- /dev/null +++ b/BUT1/CONTROLE/CM1/exo2.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) { + printf("%d\n", 58); + printf("%o\n", 47); /* IMPOSSIBLE A AFFICHER CAR LE 8 n'existe pas en base octal ... comme le 2 n'existe pas en base décimal donc 47 pour 57 à la limite*/ + printf("%x\n", 0x58); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/exo3.c b/BUT1/CONTROLE/CM1/exo3.c new file mode 100644 index 0000000..ff90569 --- /dev/null +++ b/BUT1/CONTROLE/CM1/exo3.c @@ -0,0 +1,44 @@ +#include +#include + +int main(void) { + double taille_utilisateur; /* taille en cm /// Justification nom de vaiable = taille_utilisateur car c'est la taille taper par l'utilisateur*/ + int i,pied=0,pouce=0; + printf("Entrez votre taille : "); + scanf("%lf",&taille_utilisateur); /* lf car c'est un double*/ + + /* S'occupe de retirer l'équivalent de 1 pied à la taille en cm et d'ajouter 1 à pied*/ + for(i=0;taille_utilisateur>=0.3048;i++){ + taille_utilisateur = taille_utilisateur - 0.3048; + pied++; + } + + /* S'occupe de retirer l'équivalent de 1 pouce à la taille en cm et d'ajouter 1 à pouce*/ + for(i=0;taille_utilisateur>=0.0256;i++){ + taille_utilisateur = taille_utilisateur - 0.0256; + pouce++; + } + + + if(pied>0){ + if(pied==1){ + printf("%d pied et",pied); + }else{ + printf("%d pieds",pied); + } + } + + if(pied>0 && pouce>0){ + printf(" et "); + } + + if(pouce>0){ + if(pouce==1){ + printf("%d pouce ",pouce); + }else{ + printf("%d pouces ",pouce); + } + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/exo4.c b/BUT1/CONTROLE/CM1/exo4.c new file mode 100644 index 0000000..e449dc0 --- /dev/null +++ b/BUT1/CONTROLE/CM1/exo4.c @@ -0,0 +1,18 @@ +#include +#include + +int main(){ + char lettre,alphabet; + printf("Entrez une minuscule : "); + scanf("%c", &lettre); /* ou lettre = getchar() mais cela reviens au même*/ + alphabet = 'a'; + /* Je n'ai trouver aucune solution pour utiliser une boucle for dans cette situation (Désoler...)*/ + while(alphabet <= 'z'){ + (alphabet != lettre) && printf("%c", alphabet); + (alphabet == lettre) && printf("[%c]", alphabet); + alphabet++; + } + printf("\n"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM1/exo5.c b/BUT1/CONTROLE/CM1/exo5.c new file mode 100644 index 0000000..73769f8 --- /dev/null +++ b/BUT1/CONTROLE/CM1/exo5.c @@ -0,0 +1,36 @@ +#include +#include + +int main() { + int des[5]; + int j,i; + int maxOccurrences = 0, occurrences; + + for (i=0;i<5;i++) { + printf("Jet n°%d : ", i + 1); + scanf("%d",&des[i]); + + /*Vérifier que la valeur donner est entre 1 et 6*/ + if(des[i]<1 || des[i]>6) { + printf("Veuillez entrer un entier entre 1 et 6.\n"); + i--; + } + } + + /*Compter les occurrences de chaque nombre*/ + for(i=1;i<=6;i++){ + occurrences = 0; + for(j=0;j<5;j++){ + if(des[j] == i){ + occurrences++; + } + } + if(occurrences > maxOccurrences){ + maxOccurrences = occurrences; + } + } + + printf("Occurrences maximum : %d\n", maxOccurrences); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM3/exo1/exo1.c b/BUT1/CONTROLE/CM3/exo1/exo1.c new file mode 100644 index 0000000..1504472 --- /dev/null +++ b/BUT1/CONTROLE/CM3/exo1/exo1.c @@ -0,0 +1,51 @@ +#include +#include + +void modifierImage(char *nomFichier) { + int pixel, largeur, hauteur, intensiteMax; + char commentaire[256],enTete[3]; + FILE *fichier = fopen(nomFichier, "r+"); + + if (fichier == NULL) { + fprintf(stderr,"Impossible d'ouvrir le fichier !"); + return; + } + + /* Lire l'en-tête */ + fscanf(fichier, "%2s", enTete); + + if (enTete[0] != 'P' || enTete[1] != '2') { + printf("Le fichier n'est pas au format PPM ASCII.\n"); + fclose(fichier); + return; + } + + /* Ignorer les commentaires s'il y en a*/ + while (fgetc(fichier) == '#') { + fgets(commentaire, sizeof(commentaire), fichier); + } + + /* Lire les dimensions et l'intensité maximale*/ + fscanf(fichier, "%d %d %d", &largeur, &hauteur, &intensiteMax); + + /* Modifier les pixels du message en blanc*/ + fseek(fichier, ftell(fichier), SEEK_SET); /* Revenir au début des données d'image*/ + + while ((pixel = fgetc(fichier)) != EOF) { + /* Modifier uniquement les pixels correspondant au message (intensité 3)*/ + if (pixel == 3) { + fseek(fichier, -1, SEEK_CUR); + fprintf(fichier, "5 "); + } + } + + fclose(fichier); +} + +int main(void) { + char nomFichier[] = "image.pgm"; + modifierImage(nomFichier); + printf("Modification terminée avec succès.\n"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM3/exo1/image.pgm b/BUT1/CONTROLE/CM3/exo1/image.pgm new file mode 100644 index 0000000..e69de29 diff --git a/BUT1/CONTROLE/CM3/exo2/exo2.c b/BUT1/CONTROLE/CM3/exo2/exo2.c new file mode 100644 index 0000000..aac771b --- /dev/null +++ b/BUT1/CONTROLE/CM3/exo2/exo2.c @@ -0,0 +1,47 @@ +#include +#include + +/* Fonction récursive pour trouver le maximum entre deux entiers*/ +int maxRecursif(int a, int b) { + return (a > b) ? a : b; +} + +/* Fonction récursive pour trouver le maximum dans un tableau d'entiers*/ +int maxTableauRecursif(int tableau[], int taille) { + if (taille == 1) { + return tableau[0]; + } + + return maxRecursif(tableau[taille - 1], maxTableauRecursif(tableau, taille - 1)); +} + +int main(int argc, char* argv[]) { + int i,max; + int* entiers; + if (argc < 2) { + perror("Usage: ./a.out \n"); + return EXIT_FAILURE; + } + + /* Allouer de la mémoire pour stocker les entiers fournis en ligne de commande*/ + entiers = (int*)malloc((argc - 1) * sizeof(int)); + + if (entiers == NULL) { + perror("Erreur d'allocation mémoire"); + return EXIT_FAILURE; + } + + /* Convertir les arguments en entiers et les stocker dans le tableau*/ + for (i = 1; i < argc; i++) { + entiers[i - 1] = atoi(argv[i]); + } + + /* Trouver et afficher le plus grand entier récursivement*/ + max = maxTableauRecursif(entiers, argc - 1); + printf("%d\n", max); + + /* Libérer la mémoire allouée pour le tableau*/ + free(entiers); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/CM3/exo3/exo3.c b/BUT1/CONTROLE/CM3/exo3/exo3.c new file mode 100644 index 0000000..a0db940 --- /dev/null +++ b/BUT1/CONTROLE/CM3/exo3/exo3.c @@ -0,0 +1,98 @@ +#include +#include +#include + +/* Structure pour un nœud dans la liste chaînée*/ +typedef struct Noeud { + int digit; + struct Noeud* suivant; +} Noeud; + +/* Fonction pour convertir une représentation décimale en liste chaînée*/ +Noeud* convertirListeChainee(char* nombre) { + Noeud* liste = NULL; + int i; + int length = strlen(nombre); + + for (i = length - 1; i >= 0; i--) { + Noeud* nouveauNoeud = (Noeud*)malloc(sizeof(Noeud)); + nouveauNoeud->digit = nombre[i] - '0'; + nouveauNoeud->suivant = liste; + liste = nouveauNoeud; + } + + return liste; +} + +/* Fonction pour afficher une liste chaînée*/ +void AfficherListe(Noeud* liste) { + while (liste != NULL) { + printf("%d", liste->digit); + liste = liste->suivant; + } + printf("\n"); +} + +/* Fonction pour additionner deux listes chaînées*/ +Noeud* ajouterAListe(Noeud* num1, Noeud* num2) { + Noeud* resultat = NULL; + Noeud* actuel = NULL; + Noeud* nouveauNoeud = NULL; + int retenue = 0; + int somme; + + while (num1 != NULL || num2 != NULL || retenue != 0) { + somme = retenue; + + if (num1 != NULL) { + somme += num1->digit; + num1 = num1->suivant; + } + + if (num2 != NULL) { + somme += num2->digit; + num2 = num2->suivant; + } + + nouveauNoeud = (Noeud*)malloc(sizeof(Noeud)); + nouveauNoeud->digit = somme % 10; + nouveauNoeud->suivant = NULL; + + retenue = somme / 10; + + if (resultat == NULL) { + resultat = nouveauNoeud; + actuel = resultat; + } else { + actuel->suivant = nouveauNoeud; + actuel = nouveauNoeud; + } + } + + return resultat; +} + +int main(int argc, char* argv[]) { + Noeud* num1 = NULL; + Noeud* num2 = NULL; + Noeud* somme = NULL; + char* nombre1; + char* nombre2; + if (argc != 3) { + perror("Usage: %s \n"); + return EXIT_FAILURE; + } + + nombre1 = argv[1]; + nombre2 = argv[2]; + + + num1 = convertirListeChainee(nombre1); + num2 = convertirListeChainee(nombre2); + somme = ajouterAListe(num1, num2); + + + AfficherListe(somme); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/CONTROLE/stiti_CM1.tar.gz b/BUT1/CONTROLE/stiti_CM1.tar.gz new file mode 100644 index 0000000..87f9a6a Binary files /dev/null and b/BUT1/CONTROLE/stiti_CM1.tar.gz differ diff --git a/BUT1/CONTROLE/stiti_CM3.tar.gz b/BUT1/CONTROLE/stiti_CM3.tar.gz new file mode 100644 index 0000000..2a67ea6 Binary files /dev/null and b/BUT1/CONTROLE/stiti_CM3.tar.gz differ diff --git a/BUT1/DEV1.1/Adresses/alphabet.c b/BUT1/DEV1.1/Adresses/alphabet.c new file mode 100644 index 0000000..ef3c433 --- /dev/null +++ b/BUT1/DEV1.1/Adresses/alphabet.c @@ -0,0 +1,16 @@ +#include +#include + +int main(void) +{ + char min, maj; + char *p = NULL; + + for (min = 'a', maj = 'A'; maj <= 'Z'; min++, maj++) + { + p = (p == &min) ? &maj : &min; + putchar(*p); + } + putchar('\n'); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Adresses/cartographie.c b/BUT1/DEV1.1/Adresses/cartographie.c new file mode 100644 index 0000000..6e4c0ac --- /dev/null +++ b/BUT1/DEV1.1/Adresses/cartographie.c @@ -0,0 +1,58 @@ +#include +#include +#include + +int main(void) +{ + + float fl = 0; + double dbl = 0; + long double ldbl = 0; + char caractere = 0; + short int shint = 0; + int entier = 0; + long long unsigned int llunsint = 0; + + printf("La valeur du float vaut : %f\n", fl); + printf("L'adresse de la variable float est : %p\n", &fl); + + printf("La valeur du double vaut : %lf\n", dbl); + printf("L'adresse de la variable double est : %p\n", &dbl); + + printf("La valeur du long double vaut : %Lf\n", ldbl); + printf("L'adresse de la variable long double est : %p\n", &ldbl); + + printf("La valeur du char vaut : %c\n", caractere); + printf("L'adresse de la variable char est : %p\n", &caractere); + + printf("La valeur du short int vaut : %hd\n", shint); + printf("L'adresse de la variable short int est : %p\n", &shint); + + printf("La valeur du int vaut : %d\n", entier); + printf("L'adresse de la variable int est : %p\n", &entier); + + printf("La valeur du long long unsigned int vaut : %llu\n", llunsint); + printf("L'adresse de la variable long long unsigned int est : %p\n", &llunsint); + + /* + 140723563022365 char +140723563022366 short int +140723563022368 float +140723563022372 int +140723563022376 double +140723563022384 long double + + +0x7ffe34119615 char 8 bits +0x7ffe34119616 short int 16 bits +0x7ffe34119618 float 32 bits +0x7ffe3411961c int 32 bits +0x7ffe34119620 double 64 bits +0x7ffe34119628 long long unsigned int 64 bits +0x7ffe34119630 long double 64 bits + +// chaque variable est attribuée à un espace précis mais l'emplacement de la mémoire est choisi aléatoirement + + + */ +} diff --git a/BUT1/DEV1.1/Adresses/conversion.c b/BUT1/DEV1.1/Adresses/conversion.c new file mode 100644 index 0000000..c85ac1a --- /dev/null +++ b/BUT1/DEV1.1/Adresses/conversion.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main(void) { + long long int n = 4614256656552045848LL; + double* p = (double*) &n; + printf("π = %f\n", *p); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Adresses/etapes.c b/BUT1/DEV1.1/Adresses/etapes.c new file mode 100644 index 0000000..c786f50 --- /dev/null +++ b/BUT1/DEV1.1/Adresses/etapes.c @@ -0,0 +1,29 @@ +#include +#include +int main(void) { + int a = 1, b = 2, c = 3; + int *p, *q; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*p); + p=&a; + q=&c; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + *p=(*q)++; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + p=q; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + q=&b; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + *p-=*q; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + ++*q; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + *p*=*q; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + a=++*q**p; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + p=&a; + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + *q=*p/(*q); + printf("%d,%d,%d,%d,%d\n",a,b,c,*p,*q); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Adresses/mortvivant.c b/BUT1/DEV1.1/Adresses/mortvivant.c new file mode 100644 index 0000000..95e4df9 --- /dev/null +++ b/BUT1/DEV1.1/Adresses/mortvivant.c @@ -0,0 +1,25 @@ + +#include +#include +#include + +int main(void) { + int* p; + + if(time(NULL)%2) { + int x = 59; + p = &x; + } else { + int y = 31; + p = &y; + } + /* fragment inactif + printf("x=%d\n", x); + printf("y=%d\n", y); + */ + + printf("%d\n", *p); + return EXIT_SUCCESS; +} + +// j'ai compris le fonctionnement du programme : time(NULL) correspond à l'horloge et au temps actuel, la valeur change donc constamment. Si la division renvoie un reste, on éxécute le if, si la division ne renvoie pas de reste, on éxécute le else. diff --git a/BUT1/DEV1.1/Allocation_Dynamique/1.c b/BUT1/DEV1.1/Allocation_Dynamique/1.c new file mode 100644 index 0000000..aa6edf9 --- /dev/null +++ b/BUT1/DEV1.1/Allocation_Dynamique/1.c @@ -0,0 +1,33 @@ +#include +#include + +int main(void){ + + /*avec allocation dynamique*/ + int nombre_de_reels,i,j,b=0; + double *tab_reel = NULL; + printf("Combien de valeur souhaité vous ajouter à votre tableau ? : "); + scanf("%d",&nombre_de_reels); + tab_reel = (double*) malloc(nombre_de_reels*sizeof(double)); + + for(i=0;i +#include + +char inverse(const char* s){ + + return EXIT_SUCCESS; +} + +int main(void){ + +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Bibliotheque_Math/arctique.c b/BUT1/DEV1.1/Bibliotheque_Math/arctique.c new file mode 100644 index 0000000..3dc42f2 --- /dev/null +++ b/BUT1/DEV1.1/Bibliotheque_Math/arctique.c @@ -0,0 +1,22 @@ +#include +#include +#include + +int main (void) +{ + double R; + double fi; + double x; + double y; + + printf("Entrez les coordonnées correspondant au rayon sur le plan :\n", R); + scanf("%lf" , &R); //R est le rayon + printf("Entrez les coordonnées correspondant à fi sur le plan :\n", fi); + scanf("%lf" , &fi); //fi est l'angle par rapport à l'axe des abssices + x=R*cos(fi); // on convertit les coordonnées polaires en cartésien ici + y=R*sin(fi); + + printf("Les coordonnées en x sont : %lf\n" , x); + printf("Les coordonnées en y sont : %lf\n" , y); + return EXIT_SUCCESS; //on peut mettre return 0; aussi il me semble +} diff --git a/BUT1/DEV1.1/Bibliotheque_Math/chiffres.c b/BUT1/DEV1.1/Bibliotheque_Math/chiffres.c new file mode 100644 index 0000000..4affd56 --- /dev/null +++ b/BUT1/DEV1.1/Bibliotheque_Math/chiffres.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main (void) +{ + + double nombre=0; + + printf("Entrez un réel :\n"); + scanf("%lf", &nombre); + printf("Le nombre réel est : %lf\n" , nombre); + int x = (int) trunc(nombre); + int y = (int) trunc(nombre*10); + printf("Le chiffre des unités est : %d\n" , x%10); + printf("Le chiffre des dixièmes est : %d\n" , y%10); + return 0; +} diff --git a/BUT1/DEV1.1/Bibliotheque_Math/distance.c b/BUT1/DEV1.1/Bibliotheque_Math/distance.c new file mode 100644 index 0000000..7c121d5 --- /dev/null +++ b/BUT1/DEV1.1/Bibliotheque_Math/distance.c @@ -0,0 +1,23 @@ +#include +#include +#include + +int main (void) +{ + + double x1, x2, y1, y2, distance; + + printf("Saisissez les coordonnées x du plan:\n"); + scanf("%lf", &x1); + printf("Saisissez les coordonnées x du plan :\n"); + scanf("%lf", &x2); + printf("Saisissez les coordonnées y du plan :\n"); + scanf("%lf", &y1); + printf("Saisissez les coordonnées y du plan :\n"); + scanf("%lf", &y2); + + distance = sqrt((y1-x1)*(y1-x1) + (y2-x2)*(y2-x2)); + printf("La Distance entre (%.2lf,%.2lf) et (%.2lf,%.2lf) = %f\n", x1, x2, y1, y2, distance); + + return 0; +} diff --git a/BUT1/DEV1.1/Bibliotheque_Math/dureedevol.c b/BUT1/DEV1.1/Bibliotheque_Math/dureedevol.c new file mode 100644 index 0000000..8dc42bc --- /dev/null +++ b/BUT1/DEV1.1/Bibliotheque_Math/dureedevol.c @@ -0,0 +1,19 @@ +#include +#include +#include +int main(void) { + double vitesse_avion; + double vitesse_vent; + double distance; + double duree; + printf("vitesse de l'avion en km/h : "); + scanf("%lf",&vitesse_avion); + printf("vitesse du vent en km/h : "); + scanf("%lf",&vitesse_vent); + printf("distance du trajet en km : "); + scanf("%lf",&distance); + duree = distance / vitesse_avion; + printf("durée du vol en heures : "); + printf("%lf\n", duree); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Boucles/bornes.c b/BUT1/DEV1.1/Boucles/bornes.c new file mode 100644 index 0000000..7c0c6fb --- /dev/null +++ b/BUT1/DEV1.1/Boucles/bornes.c @@ -0,0 +1,43 @@ +#include +#include +int main(void) +{ + int valeurMax; + int valeurMin; + int valeurActuelle; + + printf("Saisissez un entier supérieur ou égal à 0 :\n"); + printf("Ou saisissez -1 pour arrêter le programme : "); + scanf("%d", &valeurActuelle); + valeurMax = valeurActuelle; + valeurMin = valeurActuelle; + + if (valeurActuelle == -1) + { + printf("Vous n'avez saisi aucune valeur"); + return EXIT_SUCCESS; + } + while (valeurActuelle != -1) + { + if (valeurActuelle < 0) + { + printf("Merci de saisir un entier supérieur ou égale à 0"); + return EXIT_SUCCESS; + } + if (valeurActuelle > valeurMax) + { + valeurMax = valeurActuelle; + } + if (valeurActuelle < valeurMin) + { + valeurMin = valeurActuelle; + } + printf("Saisir valeur la suivante (-1 = stop) : \n"); + scanf("%d", &valeurActuelle); + } + printf("Valeur minimale saisie : "); + printf("%d\n", valeurMin); + printf("Valeur maximale saisie : "); + printf("%d\n", valeurMax); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/division.c b/BUT1/DEV1.1/Boucles/division.c new file mode 100644 index 0000000..6dea387 --- /dev/null +++ b/BUT1/DEV1.1/Boucles/division.c @@ -0,0 +1,36 @@ +#include +#include +int main(void) +{ + int numerateur = 0; + int denominateur = 0; + int quotient = 0; + printf("Saisissez un entier : "); + scanf("%d", &numerateur); + printf("Saisissez un entier strictement positif : "); + scanf("%d", &denominateur); + if (numerateur >= 0) + { + while (numerateur >= denominateur) + { + numerateur -= denominateur; + quotient += 1; + } + } + else + { + while (numerateur < 0) + { + numerateur += denominateur; + quotient -= 1; + } + } + printf("%d", quotient * denominateur + numerateur); + printf(" = "); + printf("%d", quotient); + printf(" x "); + printf("%d", denominateur); + printf(" + "); + printf("%d\n", numerateur); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/filtrage.c b/BUT1/DEV1.1/Boucles/filtrage.c new file mode 100644 index 0000000..da32315 --- /dev/null +++ b/BUT1/DEV1.1/Boucles/filtrage.c @@ -0,0 +1,15 @@ +#include +#include +int main(void) +{ + double note_du_bac = 0; + do + { + printf("Saisissez une note de bac comprise entre 0 et 10 : \n"); + scanf("%lf", ¬e_du_bac); + + } while (note_du_bac >= 10); + + printf("Votre notre de bac est comprise entre 0 et 10.\n"); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/s#U00e9quencedowhile.c b/BUT1/DEV1.1/Boucles/s#U00e9quencedowhile.c new file mode 100644 index 0000000..19c625b --- /dev/null +++ b/BUT1/DEV1.1/Boucles/s#U00e9quencedowhile.c @@ -0,0 +1,30 @@ +#include +#include +int main(void) +{ + int nombre1 = 0; + int nombre2 = 0; + + printf("Saisissez un nombre entier :\n"); + scanf("%d", &nombre1); + + printf("Saisissez le second nombre :\n"); + scanf(" %d", &nombre2); + + if (nombre1 > nombre2) + { + + printf("Erreur : le premier nombre est supérieur au second. \n"); + } + else + { + + nombre1 = nombre1 + 1; + do + { + + printf("%d\n", nombre1); + nombre1 = nombre1 + 1; + } while (nombre1 < nombre2); + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/s#U00e9quencefor.c b/BUT1/DEV1.1/Boucles/s#U00e9quencefor.c new file mode 100644 index 0000000..94b7b4d --- /dev/null +++ b/BUT1/DEV1.1/Boucles/s#U00e9quencefor.c @@ -0,0 +1,29 @@ +#include +#include +int main(void) +{ + int nombre1 = 0; + int nombre2 = 0; + + printf("Saisissez un nombre entier :\n"); + scanf("%d", &nombre1); + + printf("Saisissez le second nombre :\n"); + scanf(" %d", &nombre2); + + if (nombre1 > nombre2) + { + + printf("Erreur : le premier nombre est supérieur au second. \n"); + } + else + { + + for (int i = nombre1; i < nombre2; i++) + + { + + printf("%d\n", i); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/s#U00e9quencewhile.c b/BUT1/DEV1.1/Boucles/s#U00e9quencewhile.c new file mode 100644 index 0000000..9ede0fa --- /dev/null +++ b/BUT1/DEV1.1/Boucles/s#U00e9quencewhile.c @@ -0,0 +1,30 @@ +#include +#include +int main(void) +{ + int nombre1 = 0; + int nombre2 = 0; + + printf("Saisissez un nombre entier :\n"); + scanf("%d", &nombre1); + + printf("Saisissez le second nombre :\n"); + scanf(" %d", &nombre2); + + if (nombre1 > nombre2) + { + + printf("Erreur : le premier nombre est supérieur au second. \n"); + } + else + { + + while (nombre1 < nombre2-1) + + { + nombre1++; + + printf("%d\n", nombre1); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles/table.c b/BUT1/DEV1.1/Boucles/table.c new file mode 100644 index 0000000..79d9bb7 --- /dev/null +++ b/BUT1/DEV1.1/Boucles/table.c @@ -0,0 +1,15 @@ +#include +#include +int main(void) +{ + + int nombre1 = 0; + + printf("Saisissez un nombre entier \n"); + scanf("%d", &nombre1); + + for (int i = 1; i <= 10; i++) + { + printf("%d * %4d = %6d\n", nombre1, i, nombre1 * i); + } +} diff --git a/BUT1/DEV1.1/Boucles/tables.c b/BUT1/DEV1.1/Boucles/tables.c new file mode 100644 index 0000000..515157c --- /dev/null +++ b/BUT1/DEV1.1/Boucles/tables.c @@ -0,0 +1,24 @@ +#include +#include +int main(void) +{ + int table; + printf("Choisissez la table de multiplication que vous voulez afficher :\n"); + printf("Ou saisissez -1 pour stopper le programme : "); + scanf("%d", &table); + while (table != -1) + { + int i; + for (i = 0; i <= 10; i += 1) + { + printf("%d", i); + printf(" x "); + printf("%d", table); + printf(" = "); + printf("%d\n", i * table); + } + printf("Table à afficher (-1 = stop) : "); + scanf("%d", &table); + } + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Boucles_encore/figures.c b/BUT1/DEV1.1/Boucles_encore/figures.c new file mode 100644 index 0000000..91b28ad --- /dev/null +++ b/BUT1/DEV1.1/Boucles_encore/figures.c @@ -0,0 +1,47 @@ +#include +#include + +void triangle(){ + +} +int main(void) { + int hauteur_figure,ligne,colonne; + char choix_utilisateur; + while (choix_utilisateur!='q'){ + printf("t) Triangle\n"); + printf("c) Carré\n"); + printf("q) Quitter\n"); + printf("Votre choix ? "); + choix_utilisateur = getchar(); + printf("\n"); + if ((choix_utilisateur=='t')||(choix_utilisateur=='c')){ + printf("Hauteur ? "); + scanf("%d", &hauteur_figure); + printf("\n"); + for (ligne=1;ligne<=hauteur_figure;ligne+=1){ + if (choix_utilisateur=='t'){ + int caractere; + for (caractere=1;caractere<=ligne;caractere+=1){ + printf("*"); + } + printf("\n"); + } + if (choix_utilisateur=='c'){ + for (colonne=1;colonne<=hauteur_figure;colonne+=1){ + if ((colonne==1)||(ligne==1)||(colonne==hauteur_figure)||(ligne==hauteur_figure)){ + printf("*"); + } else{ + printf(" "); + } + } + printf("\n"); + } + } + printf("_____________________\n"); + choix_utilisateur = getchar(); + } + } + printf("Au revoir...\n"); + + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Boucles_encore/figures2.c b/BUT1/DEV1.1/Boucles_encore/figures2.c new file mode 100644 index 0000000..28f1007 --- /dev/null +++ b/BUT1/DEV1.1/Boucles_encore/figures2.c @@ -0,0 +1,52 @@ +#include +#include + + +int main(void) { + /*X et Y c'est juste pour faire tourner les boucles => un compteur + le h c'est hauteur + le c c'est pour faire tourner une boule infini*/ + int x,y,h,c; + char choix; + printf("t) Triangle\nc) Carré\nq) Quitter\nVotre choix : "); + scanf("%c",&choix); + for(c=0;c!=-1;c++){ + if(choix == 't'){ + printf("hauteur ? "); + scanf("%d",&h); + for(x=0;x +#include + +int main(void) +{ + int hauteur = 0; + + printf("Hauteur ? "); + scanf("%d", &hauteur); + + for (int i = 0; i < hauteur; i++) + { + int espace = hauteur - i; + printf("%*c", espace, '*'); + + if (i != 0) + { + for (int j = 0; j < i * 2; j++) + { + printf("*"); + } + } + + printf("\n"); + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles_suite/devinette.c b/BUT1/DEV1.1/Boucles_suite/devinette.c new file mode 100644 index 0000000..912f102 --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/devinette.c @@ -0,0 +1,43 @@ +#include +#include +#include +int main(void) +{ + + int generate_random(int min, int max){ + return min + rand() / (RAND_MAX / (max - min + 1)+1); + + void main(){ + + srand(time(NULL)); + + int random_number = generate_random(0,100); + int num=0; + + + + + + for(int i = 0; i<5; i++){ + printf("Devinez mon nombre entre 1 et 100 \n"); + scanf("%d", &num); + + if(random_number==num){ + + printf("Vous avez trouvez mon nombre, gagné !\n"); + break; + } + + else if(num>random_number){ + + printf("Le nombre est plus petit\n"); + } + else + { + printf("Le nombre est plus grand\n"); + } + } + printf("Le nombre était %d\n", random_number); + } + } +} diff --git a/BUT1/DEV1.1/Boucles_suite/facteurs.c b/BUT1/DEV1.1/Boucles_suite/facteurs.c new file mode 100644 index 0000000..60c081c --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/facteurs.c @@ -0,0 +1,33 @@ +#include +#include +int main(void) +{ + int nombreSaisi; + int nombre = nombreSaisi; + int premier; + printf("Saisissez un entier naturel : "); + scanf("%d", &nombreSaisi); + printf("%d", nombreSaisi); + printf(" = "); + for (premier = 2; (premier <= nombreSaisi) || (nombreSaisi != 1); premier += 1) + { + int diviseur; + for (diviseur = 1; (premier % diviseur != 0) && (diviseur == 1); diviseur += 1) + { + if (premier - 1 == diviseur) + { + int occurence; + for (occurence = 0; nombreSaisi % premier == 0; occurence += 1) + { + nombreSaisi = nombreSaisi / premier; + } + printf(" x "); + printf("%d", premier); + printf("^"); + printf("%d", occurence); + } + } + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles_suite/figures.c b/BUT1/DEV1.1/Boucles_suite/figures.c new file mode 100644 index 0000000..332a354 --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/figures.c @@ -0,0 +1,47 @@ +#include +#include +int main(void) +{ + int nombreSaisi; + int carre1; + int carre2; + int carre3; + int carre4; + printf("Saisissez un entier naturel : "); + scanf("%d", &nombreSaisi); + for (carre1 = 0; carre1 * carre1 * 4 < nombreSaisi; carre1 += 1) + { + } + for (; carre1 * carre1 <= nombreSaisi; carre1 += 1) + { + for (carre2 = 0; carre1 * carre1 + carre2 * carre2 * 3 < nombreSaisi; carre2 += 1) + { + } + for (; carre1 * carre1 + carre2 * carre2 <= nombreSaisi; carre2 += 1) + { + for (carre3 = 0; carre1 * carre1 + carre2 * carre2 + carre3 * carre3 * 2 < nombreSaisi; carre3 += 1) + { + } + for (; carre1 * carre1 + carre2 * carre2 + carre3 * carre3 <= nombreSaisi; carre3 += 1) + { + for (carre4 = 0; carre1 * carre1 + carre2 * carre2 + carre3 * carre3 + carre4 * carre4 < nombreSaisi; carre4 += 1) + { + } + if (carre1 * carre1 + carre2 * carre2 + carre3 * carre3 + carre4 * carre4 == nombreSaisi) + { + printf("%d", nombreSaisi); + printf(" = "); + printf("%d", carre1); + printf("^2 + "); + printf("%d", carre2); + printf("^2 +"); + printf("%d", carre3); + printf("^2 + "); + printf("%d", carre4); + printf("^2\n"); + } + } + } + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles_suite/primarite.c b/BUT1/DEV1.1/Boucles_suite/primarite.c new file mode 100644 index 0000000..a0527ae --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/primarite.c @@ -0,0 +1,24 @@ +#include +#include +#include +int main (void){ + + int entier_utilisateur=0; + int i=0; + + printf("Saisissez un nombre entier : \n"); + scanf("%d" , &entier_utilisateur); + + for(i=entier_utilisateur-1;i>1;i-=1){ + + if(entier_utilisateur%i==0){ + printf("Ce nombre n'est pas premier\n"); + } + } + if(entier_utilisateur==1){ + printf("Ce nombre n'est pas premier\n"); + } + printf("Ce nombre est premier\n"); + return EXIT_SUCCESS; + } + diff --git a/BUT1/DEV1.1/Boucles_suite/progression.c b/BUT1/DEV1.1/Boucles_suite/progression.c new file mode 100644 index 0000000..f2d6e4b --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/progression.c @@ -0,0 +1,32 @@ +#include +#include +int main(void) +{ + int i; + int n0 = 0; + int n1 = 1; + int n; + printf("Saisissez un entier : "); + scanf("%d", &n); + for (i = 0; i < n; i += 1) + { + if (i % 2 == 0) + { + n0 = n0 + n1; + } + else + { + n1 = n0 + n1; + } + } + if (n % 2 == 0) + { + printf("%d\n", n0); + } + else + { + printf("%d\n", n1); + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Boucles_suite/tables.c b/BUT1/DEV1.1/Boucles_suite/tables.c new file mode 100644 index 0000000..1f6b04b --- /dev/null +++ b/BUT1/DEV1.1/Boucles_suite/tables.c @@ -0,0 +1,63 @@ +#include +#include +int main(void) +{ + int taille; + int x; + printf("Saisissez la taille de la table de multiplication que vous souhaitez : "); + scanf("%d", &taille); + for (x = -2; x <= taille; x += 1) + { + int y; + printf("\n"); + for (y = -2; y <= taille; y += 1) + { + if (x == -2) + { + if (y == -2) + { + printf(" X "); + } + if (y == -1) + { + printf(" | "); + } + if (y >= 0) + { + printf("%3d", y); + } + } + if (x == -1) + { + if (y == -2) + { + printf("---"); + } + if (y == -1) + { + printf("-+-"); + } + if (y >= 0) + { + printf("---"); + } + } + if (x >= 0) + { + if (y == -2) + { + printf("%3d", x); + } + if (y == -1) + { + printf(" | "); + } + if (y >= 0) + { + printf("%3d", x * y); + } + } + } + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2 2022/.vscode/c_cpp_properties.json b/BUT1/DEV1.1/CM2 2022/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..c2098a2 --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "linux-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "linux-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2 2022/.vscode/launch.json b/BUT1/DEV1.1/CM2 2022/.vscode/launch.json new file mode 100644 index 0000000..9255d4d --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": false, + "cwd": "/export/home/an23/stiti/DEV/DEV1.1/CM2 2022", + "program": "/export/home/an23/stiti/DEV/DEV1.1/CM2 2022/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2 2022/.vscode/settings.json b/BUT1/DEV1.1/CM2 2022/.vscode/settings.json new file mode 100644 index 0000000..bfd7745 --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/.vscode/settings.json @@ -0,0 +1,37 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wconversion", + "-Wnull-dereference", + "-Wsign-conversion" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2 2022/1/Makefile b/BUT1/DEV1.1/CM2 2022/1/Makefile new file mode 100644 index 0000000..ba0cb97 --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/1/Makefile @@ -0,0 +1,45 @@ +### VARIABLES ### + +CC = gcc +CFLAGS = -ansi \ + -pedantic +EXE = repetition_dans_tableaux +OFILES = main.o \ + repetition.o + +### BUT PAR DEFAUT ### + +but : ${EXE} + +### REGLES ESSENTIELLES ### + +programme : repetition.o main.o + $(CC) $(CFLAGS) -o programme repetition.o main.o + +repetition.o : repetition.c repetition.h + $(CC) $(CFLAGS) -c repetition.c + +main.o : main.c repetition.h + $(CC) $(CFLAGS) -c main.c + + + +${EXE} : ${OFILES} + $(CC) $(CFLAGS) -o ${EXE} ${OFILES} + +### REGLES OPTIONNELLES ### + +clean : + -rm -f ${OFILES} + +mrproper : clean but + +### BUTS FACTICES ### + +.PHONY : but clean mrproper + +### FIN ### + + + + diff --git a/BUT1/DEV1.1/CM2 2022/1/programme.c b/BUT1/DEV1.1/CM2 2022/1/programme.c new file mode 100644 index 0000000..3c75546 --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/1/programme.c @@ -0,0 +1,20 @@ +#include +#include +#include "repetition.h" + + +int main(int argc, char* argv[]){ + int i; + long* tab; + tab = (long*) malloc(argc*sizeof(long)); + + for(i=1;i +#include + +int repetition(long tab[],int taille){ + int i; + for(i=0;i +#include +#import +#include + +int main(void){ + struct +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2 2022/test/timer.c b/BUT1/DEV1.1/CM2 2022/test/timer.c new file mode 100644 index 0000000..29cc0a5 --- /dev/null +++ b/BUT1/DEV1.1/CM2 2022/test/timer.c @@ -0,0 +1,38 @@ +#include +#include +#include +#define DELTA 1000000L + +void update_timer(unsigned long int start) { + int secondes = ((Microsecondes() - start) / DELTA); + int minutes = 0; + char buf[100]; + + while (secondes >= 60) { + minutes += 1; + secondes -= 60; + } + + ChoisirEcran(3); + EffacerEcran(CouleurParComposante(54, 57, 63)); + ChoisirCouleurDessin(CouleurParNom("white")); + snprintf(buf, 100, "Temps : %02d:%02d", minutes, secondes); + EcrireTexte(20, 20, buf, 1); + CopierZone(3, 0, 0, 0, 150, 30, 0, 0); + ChoisirEcran(0); +} + +unsigned long int start_timer(unsigned long int start) { + start = Microsecondes() - start; + update_timer(start); + return start; +} + +unsigned long int stop_timer(unsigned long int start) { + return Microsecondes() - start; +} + +void wait(int sec) { + unsigned long int end = Microsecondes() + (sec * DELTA); + while (Microsecondes() <= end); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/.vscode/extensions.json b/BUT1/DEV1.1/CM2_2/.vscode/extensions.json new file mode 100644 index 0000000..e6a19ea --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "bito.bito" + ] +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/.vscode/settings.json b/BUT1/DEV1.1/CM2_2/.vscode/settings.json new file mode 100644 index 0000000..9deab0a --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "stdlib.h": "c" + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/CM2/Makefile b/BUT1/DEV1.1/CM2_2/CM2/Makefile new file mode 100644 index 0000000..6e4b3f0 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/Makefile @@ -0,0 +1,13 @@ +carre : carre.o lightness.o + gcc -ansi -pedantic -o carre carre.o lightness.o + +lightness.o : lightness.c + gcc -ansi -pedantic -c lightness.c + +carre.o : carre.c lightness.h + gcc -ansi -pedantic -c carre.c + +clean : + rm -f carre.o lightness.o + +.PHONY : clean \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/CM2/carre b/BUT1/DEV1.1/CM2_2/CM2/carre new file mode 100755 index 0000000..ff3e754 Binary files /dev/null and b/BUT1/DEV1.1/CM2_2/CM2/carre differ diff --git a/BUT1/DEV1.1/CM2_2/CM2/carre.c b/BUT1/DEV1.1/CM2_2/CM2/carre.c new file mode 100644 index 0000000..2a1d6ad --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/carre.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include "lightness.h" + +#define LIGHT 0 +#define DARK 1 +#define RED 1 +#define GREEN 2 +#define BLUE 4 +#define LIGHT_RED 217 +#define DARK_RED 124 +#define LIGHT_GREEN 157 +#define DARK_GREEN 34 +#define LIGHT_BLUE 147 +#define DARK_BLUE 19 + + + +int hue(void) { + int choice = rand()%3; + if (choice == 0) { + return RED; + } else if (choice == 1) { + return GREEN; + } else /* if (choice == 2) */ { + return BLUE; + } +} + +int main(void) { + int l, c, v; + + srand(time(NULL)); + l = lightness(); + c = hue(); + + if (c == RED) { + v = (l == LIGHT) ? LIGHT_RED : DARK_RED; + } else if (c == GREEN) { + v = (l == LIGHT) ? LIGHT_GREEN : DARK_GREEN; + } else /* if (c == BLUE) */ { + v = (l == LIGHT) ? LIGHT_BLUE : DARK_BLUE; + } + + printf("┏━━━━┓\n"); + printf("┃\33[48;5;%dm \33[m┃\n", v); + printf("┃\33[48;5;%dm \33[m┃\n", v); + printf("┗━━━━┛\n"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/CM2/exo1.c b/BUT1/DEV1.1/CM2_2/CM2/exo1.c new file mode 100644 index 0000000..3f37f0a --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/exo1.c @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char* argv[]){ /* ou "char**"" */ + long numerateur = strtol(argv[1],NULL,10); + long denominateur = strtol(argv[2],NULL,10); + ldiv_t calcul = ldiv(numerateur,denominateur); + + printf("quotient : %d\n",calcul.quot); + printf("reste : %d\n",calcul.rem); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/CM2/exo3.c b/BUT1/DEV1.1/CM2_2/CM2/exo3.c new file mode 100644 index 0000000..f2c8646 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/exo3.c @@ -0,0 +1,39 @@ +#include +#include + +int* suite(int entier){ + int i = 0, result = entier, nombre_operation; + int* tab; + + for (nombre_operation = 0; (result % 2) != 0; i++){ + result = result / 2; + } + + tab = (int*) malloc(nombre_operation * sizeof(int)); + tab[0] = entier; + + for (i = 1; (entier % 2) != 0; i++){ + entier = entier / 2; + tab[i] = entier; + printf("%d", tab[i]); + } + + return tab; +} + +int main(void){ + int i; + int* tab1 = suite(5); + int* tab2 = suite(6); + int* tab3 = suite(7); + + for(i=0;i<10;i++){ + printf("%d\n",tab1[i]); + } + + free(tab1); + free(tab2); + free(tab3); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/CM2/exo4.c b/BUT1/DEV1.1/CM2_2/CM2/exo4.c new file mode 100644 index 0000000..88358e1 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/exo4.c @@ -0,0 +1,27 @@ +#include +#include + +int main(void){ + FILE* fichier = NULL; + int taille_fichier = 0,entier = 0, resultat_fscanf = 0; + + fichier = fopen("reitne","r"); + if(fichier == NULL){ + fputs("reitne inaccessible !\n",stderr); + return EXIT_FAILURE; + } + fseek(fichier,0L,SEEK_END); + taille_fichier = ftell(fichier); + + while(1){ + resultat_fscanf = fscanf(fichier,"%d",&entier); + if(resultat_fscanf != 1){ + break; + } + } + printf("%d",entier); + + fclose(fichier); + return EXIT_SUCCESS; +} + diff --git a/BUT1/DEV1.1/CM2_2/CM2/lightness.c b/BUT1/DEV1.1/CM2_2/CM2/lightness.c new file mode 100644 index 0000000..da6f39f --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/lightness.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include "lightness.h" + +int lightness(void) { + if (time(NULL)%2) { + return LIGHT; + } else { + return DARK; + } +} diff --git a/BUT1/DEV1.1/CM2_2/CM2/lightness.h b/BUT1/DEV1.1/CM2_2/CM2/lightness.h new file mode 100644 index 0000000..0714cc3 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/CM2/lightness.h @@ -0,0 +1,9 @@ +#ifndef LIGHTNESS_H +#define LIGHTNESS_H + +#define LIGHT 0 +#define DARK 1 + +int lightness(void); + +#endif /* LIGHTNESS_H */ \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/.vscode/settings.json b/BUT1/DEV1.1/CM2_2/EntrainementDS2/.vscode/settings.json new file mode 100644 index 0000000..cd321c4 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "files.associations": { + "repetition.h": "c", + "mktime.C": "cpp" + }, + "editor.inlineSuggest.showToolbar": "onHover" +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/nanoTOseconde.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/nanoTOseconde.c new file mode 100644 index 0000000..6bfedf6 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/nanoTOseconde.c @@ -0,0 +1,16 @@ +#include +#include + +int main() { + long int nanoseconde; + int seconde; + + printf("Entrez le nombre de nanosecondes : "); + scanf("%ld", &nanoseconde); + + seconde = nanoseconde / 1000000000; + + printf("Le nombre de secondes est : %d \n", seconde); + + return 0; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/secondeTOnano.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/secondeTOnano.c new file mode 100644 index 0000000..1f81904 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/Convertisseur/secondeTOnano.c @@ -0,0 +1,16 @@ +#include +#include + +int main() { + int seconde; + long int nanoseconde; + + printf("Entrez le nombre de secondes : "); + scanf("%d",&seconde); + + nanoseconde = seconde * 1000000000; + + printf("Le nombre de nanosecondes est : %ld \n", nanoseconde); + + return 0; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/c_cpp_properties.json b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..c2098a2 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "linux-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "linux-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/launch.json b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/launch.json new file mode 100644 index 0000000..b271c7a --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": false, + "cwd": "/export/home/an23/stiti/Desktop/EntrainementDS2/SUJET1 /EXO 1", + "program": "/export/home/an23/stiti/Desktop/EntrainementDS2/SUJET1 /EXO 1/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/settings.json b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/settings.json new file mode 100644 index 0000000..bfd7745 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/.vscode/settings.json @@ -0,0 +1,37 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wconversion", + "-Wnull-dereference", + "-Wsign-conversion" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/Makefile b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/Makefile new file mode 100644 index 0000000..e202ac3 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/Makefile @@ -0,0 +1,14 @@ +# BUT PRINCIPAL +repetition_ou_pas : main.o repetition.o + gcc -ansi -pedantic -o repetition_ou_pas repetition.o main.o + +repetition.o : repetition.c + gcc -ansi -pedantic -c repetition.c + +main.o : main.c repetition.h + gcc -ansi -pedantic -c main.c + +clean : + rm -f main.o repetition.o + +.PHONY : clean \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/main.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/main.c new file mode 100644 index 0000000..4faca23 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO 1/main.c @@ -0,0 +1,25 @@ +#include +#include +#include "../EXO 1/repetition.h" + + +int main(int argc,char* argv[]){ /* Ou "char** argv" */ + int i; + long* tab; + tab = (long*) malloc(argc*sizeof(long)); + /* Création d'un tableau de argc - 1 élément (Autrement dit, création d'un tableau du nombre d'éléments donner en argument au programme sans compter le a.out)*/ + for(i=1;i +#include + +int repetition(long tab[], int taille){ + int i; + for(i=0;i +#include + +int main(void){ + FILE* fichier; + char couleur; + int i,a=5; + fichier = fopen("image","r"); + if(fichier==NULL){ + fputs("Erreur d'ouverture du fichier",stderr); + return EXIT_FAILURE; + }else{ + while(feof(fichier)!=1){ + a = fread(&couleur,1,1,fichier); + if(couleur == 0){ + printf("\n"); + }else{ + printf("\33[48;5;%hhum \33[m",couleur); + } + } + + } + + fclose(fichier); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image new file mode 100644 index 0000000..d2ac982 Binary files /dev/null and b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image differ diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image(2) b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image(2) new file mode 100644 index 0000000..d2ac982 Binary files /dev/null and b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO2/image(2) differ diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c new file mode 100644 index 0000000..ca40af6 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +int main(void){ + int i; + + struct timeval tv1; + struct timeval tv2; + + gettimeofday(&tv1,NULL); + + for(i=0;i<1000000;i++){ + sqrt(2); + } + + gettimeofday(&tv2,NULL); + + printf("%dμs",tv2.tv_usec-tv1.tv_usec); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /Lenny/main.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /Lenny/main.c new file mode 100644 index 0000000..e69de29 diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /Lenny/nom1.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /Lenny/nom1.c new file mode 100644 index 0000000..e69de29 diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/Makefile b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/Makefile new file mode 100644 index 0000000..58c892c --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/Makefile @@ -0,0 +1,34 @@ +### VARIABLES ### + +CC = gcc +CFLAGS = -ansi \ + -pedantic +EXE = valeurs_nulles +OFILES = recherche.o \ + main.o + +### BUT PAR DEFAUT ### + +but : ${EXE} + +### REGLES ESSENTIELLES ### + +recherche.o : recherche.c + +main.o : main.c recherche.h + +${EXE} : ${OFILES} + $(CC) $(CFLAGS) -o ${EXE} ${OFILES} + +### REGLES OPTIONNELLES ### + +clean : + -rm -f ${OFILES} + +mrproper : clean but + +### BUTS FACTICES ### + +.PHONY : but clean mrproper + +### FIN ### \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/main.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/main.c new file mode 100644 index 0000000..86feaa8 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO1/main.c @@ -0,0 +1,15 @@ +#include +#include +#include "recherche.h" + +int main(int argc, char* argv[]){ /* ou char** */ + int i; + double* tab; + tab = (double*) malloc(argc*sizeof(double)); + + for(i=0;i +#include + +int recherche(double tab[], int taille){ + int valeurs_null = 0, i; + + for(i=0;i +#include + +int main(int argc, char* argv[]){ + char donnees_fichier1, donnees_fichier2; + int reponse = 1; + FILE* fichier1 = fopen(argv[1],"r"); + FILE* fichier2 = fopen(argv[2],"r"); + + /* Message d'erreur s'il manque des arguments // s'il y a trop d'arguments */ + if(argc != 3){ + fputs("Erreur : Le nombre d'arguments est incorrect !\n",stderr); + return EXIT_FAILURE; + } + if(fichier1 == NULL){ + fputs("Erreur : Impossible d'accéder au fichier 1\n",stderr); + return EXIT_FAILURE; + } + if(fichier2 == NULL){ + fputs("Erreur : Impossible d'accéder au fichier 2\n",stderr); + return EXIT_FAILURE; + } + while(feof(fichier1)!=1 && feof(fichier1)!=1){ + fread(&donnees_fichier1,1,1,fichier1); + fread(&donnees_fichier2,1,1,fichier2); + if(donnees_fichier1 != donnees_fichier2){ + printf("Fichiers pas identiques !\n"); + reponse = 0; + break; + } + + + } + if(reponse == 1){ + printf("Fichiers identiques !\n"); + } + + fclose(fichier1); + fclose(fichier2); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/titi.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/titi.c new file mode 100644 index 0000000..587419b --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/titi.c @@ -0,0 +1,5 @@ +#include + +int main(void){ + +} diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/toto.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/toto.c new file mode 100644 index 0000000..1cc7a34 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO2/toto.c @@ -0,0 +1,5 @@ +#include + +int main(void){ + int a; +} diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO3/exo3.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO3/exo3.c new file mode 100644 index 0000000..2868529 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET2/EXO3/exo3.c @@ -0,0 +1,21 @@ +#include +#include +#include + +int main(void){ + struct timespec req; + req.tv_sec = 0; + req.tv_nsec = 500000000; /* 0.5 secondes*/ + + fputs("E",stderr); + nanosleep(&req,NULL); + fputs("R",stderr); + nanosleep(&req,NULL); + fputs("R",stderr); + nanosleep(&req,NULL); + fputs("E",stderr); + nanosleep(&req,NULL); + fputs("U",stderr); + nanosleep(&req,NULL); + fputs("R",stderr); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/EXO MKTIME/mktime.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/EXO MKTIME/mktime.c new file mode 100644 index 0000000..c887504 --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/EXO MKTIME/mktime.c @@ -0,0 +1,49 @@ +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + + struct tm date; + time_t timestamp; + + /* Analyse de la date fournie en argument*/ + if (sscanf(argv[1], "%d/%d/%d", &date.tm_mday, &date.tm_mon, &date.tm_year) != 3) { + fprintf(stderr, "Format de date invalide. Utilisez le format dd/mm/aa.\n"); + return 1; + } + + /*La fonction mktime attend une année en nombre d'années depuis 1900*/ + date.tm_year += 100; + /*La fonction mktime attend le mois en nombre de mois depuis janvier*/ + date.tm_mon--; + + /*Initialisation des autres champs de la structure tm*/ + date.tm_hour = 0; + date.tm_min = 0; + date.tm_sec = 0; + date.tm_wday = 0; + date.tm_yday = 0; + date.tm_isdst = -1; /*Indéterminé*/ + + /*Conversion de la structure tm en timestamp*/ + timestamp = mktime(&date); + + if (timestamp == -1) { + fprintf(stderr, "Erreur lors de la conversion de la date en timestamp.\n"); + return 1; + } + + /*Conversion du timestamp en structure tm pour obtenir le jour de la semaine*/ + localtime_r(×tamp, &date); + + /*Affichage du jour de la semaine*/ + const char *jours[] = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"}; + printf("C'est un %s.\n", jours[date.tm_wday]); + + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/conversion.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/conversion.c new file mode 100644 index 0000000..415bddd --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/conversion.c @@ -0,0 +1,25 @@ +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 3) { + fputs("Usage: ./a.out \n",stderr); + return EXIT_FAILURE; + } + + double valeur = atof(argv[1]); + char unite = argv[2][0]; + + if (unite == 'c' || unite == 'C') { + double pouces = valeur / 2.54; + printf("%.2fin\n", pouces); + } else if (unite == 'i' || unite == 'I') { + double centimetres = valeur * 2.54; + printf("%.2fcm\n", centimetres); + } else { + printf("Unité invalide. Utilisez 'cm' ou 'in'.\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/de.c b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/de.c new file mode 100644 index 0000000..7e83aba --- /dev/null +++ b/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET3/de.c @@ -0,0 +1,36 @@ +#include +#include + +int main(void) { + int resultat_lancer; + unsigned char valeur_aleatoire; + size_t octet_lu; + /* On ouvre le fichier /dev/random */ + FILE* fichier_random = fopen("/dev/random", "r"); + + /* On vérifie qu'il s'ouvre bien*/ + if (fichier_random == NULL) { + fputs("Erreur lors de l'ouverture de /dev/random", stderr); + return EXIT_FAILURE; + } + + /* On lit un octet depuis /dev/random */ + octet_lu = fread(&valeur_aleatoire, sizeof(valeur_aleatoire), 1, fichier_random); + /*On vérifie l'octet lu */ + if (octet_lu != 1) { + fputs("Erreur lors de la lecture depuis /dev/random", stderr); + fclose(fichier_random); + return EXIT_FAILURE; + } + + /* On ferme le fichier /dev/random */ + fclose(fichier_random); + + /* On calcule le résultat du dé (entre 1 et 6) */ + resultat_lancer = (valeur_aleatoire % 6) + 1; + + /* On affiche le résultat */ + printf("%d\n", resultat_lancer); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/CM2_2/stiti_CM2.tar.gz b/BUT1/DEV1.1/CM2_2/stiti_CM2.tar.gz new file mode 100644 index 0000000..9ac722b Binary files /dev/null and b/BUT1/DEV1.1/CM2_2/stiti_CM2.tar.gz differ diff --git a/BUT1/DEV1.1/Caract#U00e8res/extraction.c b/BUT1/DEV1.1/Caract#U00e8res/extraction.c new file mode 100644 index 0000000..9f4ddc4 --- /dev/null +++ b/BUT1/DEV1.1/Caract#U00e8res/extraction.c @@ -0,0 +1,26 @@ +#include +#include + +int main(void) +{ + char dizaineMois; + char uniteMois; + char dizaineAnnee; + char uniteAnnee; + + printf("Saisissez votre numéro de sécurité sociale : "); + getchar(); + + dizaineAnnee = getchar(); + uniteAnnee = getchar(); + dizaineMois = getchar(); + uniteMois = getchar(); + + printf("Vous êtes né en : "); + printf("%c", dizaineMois); + printf("%c", uniteMois); + printf("/"); + printf("%c", dizaineAnnee); + printf("%c\n", uniteAnnee); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Caract#U00e8res/lettres.c b/BUT1/DEV1.1/Caract#U00e8res/lettres.c new file mode 100644 index 0000000..8f11dd2 --- /dev/null +++ b/BUT1/DEV1.1/Caract#U00e8res/lettres.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) +{ + + printf("%c\n", 65); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Caract#U00e8res/salut2.c b/BUT1/DEV1.1/Caract#U00e8res/salut2.c new file mode 100644 index 0000000..a055d8f --- /dev/null +++ b/BUT1/DEV1.1/Caract#U00e8res/salut2.c @@ -0,0 +1,11 @@ +/* premier programme */ + +#include +#include + +int main(void) +{ + printf("%c%c%c%c%c %c%c%c%c%c%c\n", '\110', 'E', 'L', 'L', 'O', 'W', 'O', 'R', 'L', 'D', '\x21'); + + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Chaines_Caracteres/initiales.c b/BUT1/DEV1.1/Chaines_Caracteres/initiales.c new file mode 100644 index 0000000..f8e3068 --- /dev/null +++ b/BUT1/DEV1.1/Chaines_Caracteres/initiales.c @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + char prenom[30] = {0}; +/*il faut créer une chaine de caractere : Un tableau de char +où chaque char représente un caractere*/ + printf("Quel est votre prenom ?\n"); + scanf("%s", prenom); /*%s signifie chaine de caractere. +De plus il n'y a pas besoin du & pour les chaine de caractere car ce sont des pointeurs*/ + + printf("\n%c\n%c", prenom[0], prenom[1]); +//%c car tu lis un seul caractere + + return 0; +} diff --git a/BUT1/DEV1.1/Chaines_Caracteres/lecture.c b/BUT1/DEV1.1/Chaines_Caracteres/lecture.c new file mode 100644 index 0000000..4c8df5f --- /dev/null +++ b/BUT1/DEV1.1/Chaines_Caracteres/lecture.c @@ -0,0 +1,23 @@ +// NE MARCHE PAS +#include +#include +#include +int main(void) { + char motdepasse[27],vraimdp[7]="hassan",lettremdp,lettrevrai; + int taille=strlen(vraimdp),veracite=0,i; + printf("Mot de passe : "); + for (i=0;i +#include +#include +int main(int argc, char **argv) +{ + int i, j, cara; + for (i = argc - 1; i >= 0; i--) + { + cara = strlen(argv[i]); + for (j = cara; j >= 0; j--) + { + printf("%c", argv[i][j]); + } + printf(" "); + } + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Chaines_Caracteres/statistiques.c b/BUT1/DEV1.1/Chaines_Caracteres/statistiques.c new file mode 100644 index 0000000..a97f9f7 --- /dev/null +++ b/BUT1/DEV1.1/Chaines_Caracteres/statistiques.c @@ -0,0 +1,29 @@ +// NE MARCHE PAS +#include +#include +#include +int main(void) { + char phrase[201],cara; + int taille,nbe,nbcara=0,i,iprov,compte=0; + printf("Saisissez une phrase: "); + fgets(phrase,200,stdin); + taille=strlen(phrase); + for (i=0;i=0) { + if (cara==phrase[iprov]) { + compte++; + } + iprov-=1; + } + if (compte==1) { + nbcara++; + } + compte=0; + } + printf("Nombre de e: %d\nNombre de caractere differents: %d",nbe,nbcara-1); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Chaines_Caracteres/truandage.c b/BUT1/DEV1.1/Chaines_Caracteres/truandage.c new file mode 100644 index 0000000..840ab75 --- /dev/null +++ b/BUT1/DEV1.1/Chaines_Caracteres/truandage.c @@ -0,0 +1,7 @@ +#include +#include +int main(void) { + long long int n = 32204074743918434LL; + printf("%s\n",&n); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Commandes/bases.c b/BUT1/DEV1.1/Commandes/bases.c new file mode 100644 index 0000000..c43f461 --- /dev/null +++ b/BUT1/DEV1.1/Commandes/bases.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) { + printf("%d\n", 72);- + printf("%d\n", 0110); + printf("%d\n", 0x48); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Commandes/intermediaire.i b/BUT1/DEV1.1/Commandes/intermediaire.i new file mode 100644 index 0000000..3fdfb41 --- /dev/null +++ b/BUT1/DEV1.1/Commandes/intermediaire.i @@ -0,0 +1,1854 @@ +# 0 "salut.c" +# 0 "" +# 0 "" +# 1 "/usr/include/stdc-predef.h" 1 3 4 +# 0 "" 2 +# 1 "salut.c" + + +# 1 "/usr/include/stdlib.h" 1 3 4 +# 26 "/usr/include/stdlib.h" 3 4 +# 1 "/usr/include/bits/libc-header-start.h" 1 3 4 +# 33 "/usr/include/bits/libc-header-start.h" 3 4 +# 1 "/usr/include/features.h" 1 3 4 +# 392 "/usr/include/features.h" 3 4 +# 1 "/usr/include/features-time64.h" 1 3 4 +# 20 "/usr/include/features-time64.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 21 "/usr/include/features-time64.h" 2 3 4 +# 1 "/usr/include/bits/timesize.h" 1 3 4 +# 19 "/usr/include/bits/timesize.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 20 "/usr/include/bits/timesize.h" 2 3 4 +# 22 "/usr/include/features-time64.h" 2 3 4 +# 393 "/usr/include/features.h" 2 3 4 +# 490 "/usr/include/features.h" 3 4 +# 1 "/usr/include/sys/cdefs.h" 1 3 4 +# 559 "/usr/include/sys/cdefs.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 560 "/usr/include/sys/cdefs.h" 2 3 4 +# 1 "/usr/include/bits/long-double.h" 1 3 4 +# 561 "/usr/include/sys/cdefs.h" 2 3 4 +# 491 "/usr/include/features.h" 2 3 4 +# 514 "/usr/include/features.h" 3 4 +# 1 "/usr/include/gnu/stubs.h" 1 3 4 +# 10 "/usr/include/gnu/stubs.h" 3 4 +# 1 "/usr/include/gnu/stubs-64.h" 1 3 4 +# 11 "/usr/include/gnu/stubs.h" 2 3 4 +# 515 "/usr/include/features.h" 2 3 4 +# 34 "/usr/include/bits/libc-header-start.h" 2 3 4 +# 27 "/usr/include/stdlib.h" 2 3 4 + + + + + +# 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 1 3 4 +# 214 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 3 4 + +# 214 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 3 4 +typedef long unsigned int size_t; +# 329 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 3 4 +typedef int wchar_t; +# 33 "/usr/include/stdlib.h" 2 3 4 + + + + + + + +# 1 "/usr/include/bits/waitflags.h" 1 3 4 +# 41 "/usr/include/stdlib.h" 2 3 4 +# 1 "/usr/include/bits/waitstatus.h" 1 3 4 +# 42 "/usr/include/stdlib.h" 2 3 4 +# 56 "/usr/include/stdlib.h" 3 4 +# 1 "/usr/include/bits/floatn.h" 1 3 4 +# 119 "/usr/include/bits/floatn.h" 3 4 +# 1 "/usr/include/bits/floatn-common.h" 1 3 4 +# 24 "/usr/include/bits/floatn-common.h" 3 4 +# 1 "/usr/include/bits/long-double.h" 1 3 4 +# 25 "/usr/include/bits/floatn-common.h" 2 3 4 +# 120 "/usr/include/bits/floatn.h" 2 3 4 +# 57 "/usr/include/stdlib.h" 2 3 4 + + +typedef struct + { + int quot; + int rem; + } div_t; + + + +typedef struct + { + long int quot; + long int rem; + } ldiv_t; + + + + + +__extension__ typedef struct + { + long long int quot; + long long int rem; + } lldiv_t; +# 98 "/usr/include/stdlib.h" 3 4 +extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ; + + + +extern double atof (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + +extern int atoi (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + +extern long int atol (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + + + +__extension__ extern long long int atoll (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + + + +extern double strtod (const char *__restrict __nptr, + char **__restrict __endptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern float strtof (const char *__restrict __nptr, + char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +extern long double strtold (const char *__restrict __nptr, + char **__restrict __endptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +# 177 "/usr/include/stdlib.h" 3 4 +extern long int strtol (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +extern unsigned long int strtoul (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +__extension__ +extern long long int strtoq (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +__extension__ +extern unsigned long long int strtouq (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + +__extension__ +extern long long int strtoll (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +__extension__ +extern unsigned long long int strtoull (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +# 386 "/usr/include/stdlib.h" 3 4 +extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern long int a64l (const char *__s) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + + + + +# 1 "/usr/include/sys/types.h" 1 3 4 +# 27 "/usr/include/sys/types.h" 3 4 + + +# 1 "/usr/include/bits/types.h" 1 3 4 +# 27 "/usr/include/bits/types.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 28 "/usr/include/bits/types.h" 2 3 4 +# 1 "/usr/include/bits/timesize.h" 1 3 4 +# 19 "/usr/include/bits/timesize.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 20 "/usr/include/bits/timesize.h" 2 3 4 +# 29 "/usr/include/bits/types.h" 2 3 4 + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + + + + + + +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +# 141 "/usr/include/bits/types.h" 3 4 +# 1 "/usr/include/bits/typesizes.h" 1 3 4 +# 142 "/usr/include/bits/types.h" 2 3 4 +# 1 "/usr/include/bits/time64.h" 1 3 4 +# 143 "/usr/include/bits/types.h" 2 3 4 + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __suseconds64_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + + +typedef int __sig_atomic_t; +# 30 "/usr/include/sys/types.h" 2 3 4 + + + +typedef __u_char u_char; +typedef __u_short u_short; +typedef __u_int u_int; +typedef __u_long u_long; +typedef __quad_t quad_t; +typedef __u_quad_t u_quad_t; +typedef __fsid_t fsid_t; + + +typedef __loff_t loff_t; + + + + +typedef __ino_t ino_t; +# 59 "/usr/include/sys/types.h" 3 4 +typedef __dev_t dev_t; + + + + +typedef __gid_t gid_t; + + + + +typedef __mode_t mode_t; + + + + +typedef __nlink_t nlink_t; + + + + +typedef __uid_t uid_t; + + + + + +typedef __off_t off_t; +# 97 "/usr/include/sys/types.h" 3 4 +typedef __pid_t pid_t; + + + + + +typedef __id_t id_t; + + + + +typedef __ssize_t ssize_t; + + + + + +typedef __daddr_t daddr_t; +typedef __caddr_t caddr_t; + + + + + +typedef __key_t key_t; + + + + +# 1 "/usr/include/bits/types/clock_t.h" 1 3 4 + + + + + + +typedef __clock_t clock_t; +# 127 "/usr/include/sys/types.h" 2 3 4 + +# 1 "/usr/include/bits/types/clockid_t.h" 1 3 4 + + + + + + +typedef __clockid_t clockid_t; +# 129 "/usr/include/sys/types.h" 2 3 4 +# 1 "/usr/include/bits/types/time_t.h" 1 3 4 +# 10 "/usr/include/bits/types/time_t.h" 3 4 +typedef __time_t time_t; +# 130 "/usr/include/sys/types.h" 2 3 4 +# 1 "/usr/include/bits/types/timer_t.h" 1 3 4 + + + + + + +typedef __timer_t timer_t; +# 131 "/usr/include/sys/types.h" 2 3 4 +# 144 "/usr/include/sys/types.h" 3 4 +# 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 1 3 4 +# 145 "/usr/include/sys/types.h" 2 3 4 + + + +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; + + + + +# 1 "/usr/include/bits/stdint-intn.h" 1 3 4 +# 24 "/usr/include/bits/stdint-intn.h" 3 4 +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; +# 156 "/usr/include/sys/types.h" 2 3 4 + + +typedef __uint8_t u_int8_t; +typedef __uint16_t u_int16_t; +typedef __uint32_t u_int32_t; +typedef __uint64_t u_int64_t; + + +typedef int register_t __attribute__ ((__mode__ (__word__))); +# 176 "/usr/include/sys/types.h" 3 4 +# 1 "/usr/include/endian.h" 1 3 4 +# 24 "/usr/include/endian.h" 3 4 +# 1 "/usr/include/bits/endian.h" 1 3 4 +# 35 "/usr/include/bits/endian.h" 3 4 +# 1 "/usr/include/bits/endianness.h" 1 3 4 +# 36 "/usr/include/bits/endian.h" 2 3 4 +# 25 "/usr/include/endian.h" 2 3 4 +# 35 "/usr/include/endian.h" 3 4 +# 1 "/usr/include/bits/byteswap.h" 1 3 4 +# 33 "/usr/include/bits/byteswap.h" 3 4 +static __inline __uint16_t +__bswap_16 (__uint16_t __bsx) +{ + + return __builtin_bswap16 (__bsx); + + + +} + + + + + + +static __inline __uint32_t +__bswap_32 (__uint32_t __bsx) +{ + + return __builtin_bswap32 (__bsx); + + + +} +# 69 "/usr/include/bits/byteswap.h" 3 4 +__extension__ static __inline __uint64_t +__bswap_64 (__uint64_t __bsx) +{ + + return __builtin_bswap64 (__bsx); + + + +} +# 36 "/usr/include/endian.h" 2 3 4 +# 1 "/usr/include/bits/uintn-identity.h" 1 3 4 +# 32 "/usr/include/bits/uintn-identity.h" 3 4 +static __inline __uint16_t +__uint16_identity (__uint16_t __x) +{ + return __x; +} + +static __inline __uint32_t +__uint32_identity (__uint32_t __x) +{ + return __x; +} + +static __inline __uint64_t +__uint64_identity (__uint64_t __x) +{ + return __x; +} +# 37 "/usr/include/endian.h" 2 3 4 +# 177 "/usr/include/sys/types.h" 2 3 4 + + +# 1 "/usr/include/sys/select.h" 1 3 4 +# 30 "/usr/include/sys/select.h" 3 4 +# 1 "/usr/include/bits/select.h" 1 3 4 +# 31 "/usr/include/sys/select.h" 2 3 4 + + +# 1 "/usr/include/bits/types/sigset_t.h" 1 3 4 + + + +# 1 "/usr/include/bits/types/__sigset_t.h" 1 3 4 + + + + +typedef struct +{ + unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; +} __sigset_t; +# 5 "/usr/include/bits/types/sigset_t.h" 2 3 4 + + +typedef __sigset_t sigset_t; +# 34 "/usr/include/sys/select.h" 2 3 4 + + + +# 1 "/usr/include/bits/types/struct_timeval.h" 1 3 4 + + + + + + + +struct timeval +{ + + + + + __time_t tv_sec; + __suseconds_t tv_usec; + +}; +# 38 "/usr/include/sys/select.h" 2 3 4 + +# 1 "/usr/include/bits/types/struct_timespec.h" 1 3 4 +# 11 "/usr/include/bits/types/struct_timespec.h" 3 4 +struct timespec +{ + + + + __time_t tv_sec; + + + + + __syscall_slong_t tv_nsec; +# 31 "/usr/include/bits/types/struct_timespec.h" 3 4 +}; +# 40 "/usr/include/sys/select.h" 2 3 4 + + + +typedef __suseconds_t suseconds_t; + + + + + +typedef long int __fd_mask; +# 59 "/usr/include/sys/select.h" 3 4 +typedef struct + { + + + + + + + __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; + + + } fd_set; + + + + + + +typedef __fd_mask fd_mask; +# 91 "/usr/include/sys/select.h" 3 4 + +# 102 "/usr/include/sys/select.h" 3 4 +extern int select (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + struct timeval *__restrict __timeout); +# 127 "/usr/include/sys/select.h" 3 4 +extern int pselect (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + const struct timespec *__restrict __timeout, + const __sigset_t *__restrict __sigmask); +# 153 "/usr/include/sys/select.h" 3 4 + +# 180 "/usr/include/sys/types.h" 2 3 4 + + + + + +typedef __blksize_t blksize_t; + + + + + + +typedef __blkcnt_t blkcnt_t; + + + +typedef __fsblkcnt_t fsblkcnt_t; + + + +typedef __fsfilcnt_t fsfilcnt_t; +# 227 "/usr/include/sys/types.h" 3 4 +# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 +# 23 "/usr/include/bits/pthreadtypes.h" 3 4 +# 1 "/usr/include/bits/thread-shared-types.h" 1 3 4 +# 44 "/usr/include/bits/thread-shared-types.h" 3 4 +# 1 "/usr/include/bits/pthreadtypes-arch.h" 1 3 4 +# 21 "/usr/include/bits/pthreadtypes-arch.h" 3 4 +# 1 "/usr/include/bits/wordsize.h" 1 3 4 +# 22 "/usr/include/bits/pthreadtypes-arch.h" 2 3 4 +# 45 "/usr/include/bits/thread-shared-types.h" 2 3 4 + +# 1 "/usr/include/bits/atomic_wide_counter.h" 1 3 4 +# 25 "/usr/include/bits/atomic_wide_counter.h" 3 4 +typedef union +{ + __extension__ unsigned long long int __value64; + struct + { + unsigned int __low; + unsigned int __high; + } __value32; +} __atomic_wide_counter; +# 47 "/usr/include/bits/thread-shared-types.h" 2 3 4 + + + + +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; + +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; +# 76 "/usr/include/bits/thread-shared-types.h" 3 4 +# 1 "/usr/include/bits/struct_mutex.h" 1 3 4 +# 22 "/usr/include/bits/struct_mutex.h" 3 4 +struct __pthread_mutex_s +{ + int __lock; + unsigned int __count; + int __owner; + + unsigned int __nusers; + + + + int __kind; + + short __spins; + short __elision; + __pthread_list_t __list; +# 53 "/usr/include/bits/struct_mutex.h" 3 4 +}; +# 77 "/usr/include/bits/thread-shared-types.h" 2 3 4 +# 89 "/usr/include/bits/thread-shared-types.h" 3 4 +# 1 "/usr/include/bits/struct_rwlock.h" 1 3 4 +# 23 "/usr/include/bits/struct_rwlock.h" 3 4 +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; + + int __cur_writer; + int __shared; + signed char __rwelision; + + + + + unsigned char __pad1[7]; + + + unsigned long int __pad2; + + + unsigned int __flags; +# 55 "/usr/include/bits/struct_rwlock.h" 3 4 +}; +# 90 "/usr/include/bits/thread-shared-types.h" 2 3 4 + + + + +struct __pthread_cond_s +{ + __atomic_wide_counter __wseq; + __atomic_wide_counter __g1_start; + unsigned int __g_refs[2] ; + unsigned int __g_size[2]; + unsigned int __g1_orig_size; + unsigned int __wrefs; + unsigned int __g_signals[2]; +}; + +typedef unsigned int __tss_t; +typedef unsigned long int __thrd_t; + +typedef struct +{ + int __data ; +} __once_flag; +# 24 "/usr/include/bits/pthreadtypes.h" 2 3 4 + + + +typedef unsigned long int pthread_t; + + + + +typedef union +{ + char __size[4]; + int __align; +} pthread_mutexattr_t; + + + + +typedef union +{ + char __size[4]; + int __align; +} pthread_condattr_t; + + + +typedef unsigned int pthread_key_t; + + + +typedef int pthread_once_t; + + +union pthread_attr_t +{ + char __size[56]; + long int __align; +}; + +typedef union pthread_attr_t pthread_attr_t; + + + + +typedef union +{ + struct __pthread_mutex_s __data; + char __size[40]; + long int __align; +} pthread_mutex_t; + + +typedef union +{ + struct __pthread_cond_s __data; + char __size[48]; + __extension__ long long int __align; +} pthread_cond_t; + + + + + +typedef union +{ + struct __pthread_rwlock_arch_t __data; + char __size[56]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[8]; + long int __align; +} pthread_rwlockattr_t; + + + + + +typedef volatile int pthread_spinlock_t; + + + + +typedef union +{ + char __size[32]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[4]; + int __align; +} pthread_barrierattr_t; +# 228 "/usr/include/sys/types.h" 2 3 4 + + + +# 396 "/usr/include/stdlib.h" 2 3 4 + + + + + + +extern long int random (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern char *initstate (unsigned int __seed, char *__statebuf, + size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + +extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +struct random_data + { + int32_t *fptr; + int32_t *rptr; + int32_t *state; + int rand_type; + int rand_deg; + int rand_sep; + int32_t *end_ptr; + }; + +extern int random_r (struct random_data *__restrict __buf, + int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern int srandom_r (unsigned int __seed, struct random_data *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + +extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, + size_t __statelen, + struct random_data *__restrict __buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); + +extern int setstate_r (char *__restrict __statebuf, + struct random_data *__restrict __buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + +extern int rand (void) __attribute__ ((__nothrow__ , __leaf__)); + +extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern long int nrand48 (unsigned short int __xsubi[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern long int jrand48 (unsigned short int __xsubi[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__)); +extern unsigned short int *seed48 (unsigned short int __seed16v[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +struct drand48_data + { + unsigned short int __x[3]; + unsigned short int __old_x[3]; + unsigned short int __c; + unsigned short int __init; + __extension__ unsigned long long int __a; + + }; + + +extern int drand48_r (struct drand48_data *__restrict __buffer, + double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int erand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int lrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int nrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int mrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int jrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int srand48_r (long int __seedval, struct drand48_data *__buffer) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + +extern int seed48_r (unsigned short int __seed16v[3], + struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern int lcong48_r (unsigned short int __param[7], + struct drand48_data *__buffer) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern __uint32_t arc4random (void) + __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern void arc4random_buf (void *__buf, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern __uint32_t arc4random_uniform (__uint32_t __upper_bound) + __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) + __attribute__ ((__alloc_size__ (1))) ; + +extern void *calloc (size_t __nmemb, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ; + + + + + + +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2))); + + +extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) + __attribute__ ((__alloc_size__ (2, 3))) + __attribute__ ((__malloc__ (__builtin_free, 1))); + + +extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__ (reallocarray, 1))); + + + +# 1 "/usr/include/alloca.h" 1 3 4 +# 24 "/usr/include/alloca.h" 3 4 +# 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 1 3 4 +# 25 "/usr/include/alloca.h" 2 3 4 + + + + + + + +extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +# 588 "/usr/include/stdlib.h" 2 3 4 + + + + + +extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) + __attribute__ ((__alloc_size__ (1))) ; + + + + +extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + +extern void *aligned_alloc (size_t __alignment, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_align__ (1))) + __attribute__ ((__alloc_size__ (2))) ; + + + +extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + +extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + +extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + +extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + +extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +# 667 "/usr/include/stdlib.h" 3 4 +extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int setenv (const char *__name, const char *__value, int __replace) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + +extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__)); +# 695 "/usr/include/stdlib.h" 3 4 +extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +# 708 "/usr/include/stdlib.h" 3 4 +extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; +# 730 "/usr/include/stdlib.h" 3 4 +extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ; +# 751 "/usr/include/stdlib.h" 3 4 +extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +# 804 "/usr/include/stdlib.h" 3 4 +extern int system (const char *__command) ; +# 821 "/usr/include/stdlib.h" 3 4 +extern char *realpath (const char *__restrict __name, + char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + +typedef int (*__compar_fn_t) (const void *, const void *); +# 841 "/usr/include/stdlib.h" 3 4 +extern void *bsearch (const void *__key, const void *__base, + size_t __nmemb, size_t __size, __compar_fn_t __compar) + __attribute__ ((__nonnull__ (1, 2, 5))) ; + + + + + + + +extern void qsort (void *__base, size_t __nmemb, size_t __size, + __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); +# 861 "/usr/include/stdlib.h" 3 4 +extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; +extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + +__extension__ extern long long int llabs (long long int __x) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + + + + + +extern div_t div (int __numer, int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; +extern ldiv_t ldiv (long int __numer, long int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + +__extension__ extern lldiv_t lldiv (long long int __numer, + long long int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; +# 893 "/usr/include/stdlib.h" 3 4 +extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; + + + + +extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; + + + + +extern char *gcvt (double __value, int __ndigit, char *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; + + + + +extern char *qecvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; +extern char *qfcvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; +extern char *qgcvt (long double __value, int __ndigit, char *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; + + + + +extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); +extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); + +extern int qecvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); +extern int qfcvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); + + + + + +extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int mbtowc (wchar_t *__restrict __pwc, + const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern size_t mbstowcs (wchar_t *__restrict __pwcs, + const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__access__ (__read_only__, 2))); + +extern size_t wcstombs (char *__restrict __s, + const wchar_t *__restrict __pwcs, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__access__ (__write_only__, 1, 3))) + __attribute__ ((__access__ (__read_only__, 2))); + + + + + + +extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +# 980 "/usr/include/stdlib.h" 3 4 +extern int getsubopt (char **__restrict __optionp, + char *const *__restrict __tokens, + char **__restrict __valuep) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; +# 1026 "/usr/include/stdlib.h" 3 4 +extern int getloadavg (double __loadavg[], int __nelem) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +# 1036 "/usr/include/stdlib.h" 3 4 +# 1 "/usr/include/bits/stdlib-float.h" 1 3 4 +# 1037 "/usr/include/stdlib.h" 2 3 4 +# 1048 "/usr/include/stdlib.h" 3 4 + +# 4 "salut.c" 2 +# 1 "/usr/include/stdio.h" 1 3 4 +# 27 "/usr/include/stdio.h" 3 4 +# 1 "/usr/include/bits/libc-header-start.h" 1 3 4 +# 28 "/usr/include/stdio.h" 2 3 4 + + + + + +# 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stddef.h" 1 3 4 +# 34 "/usr/include/stdio.h" 2 3 4 + + +# 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stdarg.h" 1 3 4 +# 40 "/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/stdarg.h" 3 4 +typedef __builtin_va_list __gnuc_va_list; +# 37 "/usr/include/stdio.h" 2 3 4 + + +# 1 "/usr/include/bits/types/__fpos_t.h" 1 3 4 + + + + +# 1 "/usr/include/bits/types/__mbstate_t.h" 1 3 4 +# 13 "/usr/include/bits/types/__mbstate_t.h" 3 4 +typedef struct +{ + int __count; + union + { + unsigned int __wch; + char __wchb[4]; + } __value; +} __mbstate_t; +# 6 "/usr/include/bits/types/__fpos_t.h" 2 3 4 + + + + +typedef struct _G_fpos_t +{ + __off_t __pos; + __mbstate_t __state; +} __fpos_t; +# 40 "/usr/include/stdio.h" 2 3 4 +# 1 "/usr/include/bits/types/__fpos64_t.h" 1 3 4 +# 10 "/usr/include/bits/types/__fpos64_t.h" 3 4 +typedef struct _G_fpos64_t +{ + __off64_t __pos; + __mbstate_t __state; +} __fpos64_t; +# 41 "/usr/include/stdio.h" 2 3 4 +# 1 "/usr/include/bits/types/__FILE.h" 1 3 4 + + + +struct _IO_FILE; +typedef struct _IO_FILE __FILE; +# 42 "/usr/include/stdio.h" 2 3 4 +# 1 "/usr/include/bits/types/FILE.h" 1 3 4 + + + +struct _IO_FILE; + + +typedef struct _IO_FILE FILE; +# 43 "/usr/include/stdio.h" 2 3 4 +# 1 "/usr/include/bits/types/struct_FILE.h" 1 3 4 +# 35 "/usr/include/bits/types/struct_FILE.h" 3 4 +struct _IO_FILE; +struct _IO_marker; +struct _IO_codecvt; +struct _IO_wide_data; + + + + +typedef void _IO_lock_t; + + + + + +struct _IO_FILE +{ + int _flags; + + + char *_IO_read_ptr; + char *_IO_read_end; + char *_IO_read_base; + char *_IO_write_base; + char *_IO_write_ptr; + char *_IO_write_end; + char *_IO_buf_base; + char *_IO_buf_end; + + + char *_IO_save_base; + char *_IO_backup_base; + char *_IO_save_end; + + struct _IO_marker *_markers; + + struct _IO_FILE *_chain; + + int _fileno; + int _flags2; + __off_t _old_offset; + + + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + + _IO_lock_t *_lock; + + + + + + + + __off64_t _offset; + + struct _IO_codecvt *_codecvt; + struct _IO_wide_data *_wide_data; + struct _IO_FILE *_freeres_list; + void *_freeres_buf; + size_t __pad5; + int _mode; + + char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; +}; +# 44 "/usr/include/stdio.h" 2 3 4 +# 52 "/usr/include/stdio.h" 3 4 +typedef __gnuc_va_list va_list; +# 84 "/usr/include/stdio.h" 3 4 +typedef __fpos_t fpos_t; +# 133 "/usr/include/stdio.h" 3 4 +# 1 "/usr/include/bits/stdio_lim.h" 1 3 4 +# 134 "/usr/include/stdio.h" 2 3 4 +# 143 "/usr/include/stdio.h" 3 4 +extern FILE *stdin; +extern FILE *stdout; +extern FILE *stderr; + + + + + + +extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)); + +extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int renameat (int __oldfd, const char *__old, int __newfd, + const char *__new) __attribute__ ((__nothrow__ , __leaf__)); +# 178 "/usr/include/stdio.h" 3 4 +extern int fclose (FILE *__stream); +# 188 "/usr/include/stdio.h" 3 4 +extern FILE *tmpfile (void) + __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; +# 205 "/usr/include/stdio.h" 3 4 +extern char *tmpnam (char[20]) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern char *tmpnam_r (char __s[20]) __attribute__ ((__nothrow__ , __leaf__)) ; +# 222 "/usr/include/stdio.h" 3 4 +extern char *tempnam (const char *__dir, const char *__pfx) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (__builtin_free, 1))); + + + + + + +extern int fflush (FILE *__stream); +# 239 "/usr/include/stdio.h" 3 4 +extern int fflush_unlocked (FILE *__stream); +# 258 "/usr/include/stdio.h" 3 4 +extern FILE *fopen (const char *__restrict __filename, + const char *__restrict __modes) + __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; + + + + +extern FILE *freopen (const char *__restrict __filename, + const char *__restrict __modes, + FILE *__restrict __stream) ; +# 293 "/usr/include/stdio.h" 3 4 +extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; +# 308 "/usr/include/stdio.h" 3 4 +extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; + + + + +extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ; +# 328 "/usr/include/stdio.h" 3 4 +extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, + int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, + size_t __size) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern int fprintf (FILE *__restrict __stream, + const char *__restrict __format, ...); + + + + +extern int printf (const char *__restrict __format, ...); + +extern int sprintf (char *__restrict __s, + const char *__restrict __format, ...) __attribute__ ((__nothrow__)); + + + + + +extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg); + + + + +extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); + +extern int vsprintf (char *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg) __attribute__ ((__nothrow__)); + + + +extern int snprintf (char *__restrict __s, size_t __maxlen, + const char *__restrict __format, ...) + __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); + +extern int vsnprintf (char *__restrict __s, size_t __maxlen, + const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); +# 403 "/usr/include/stdio.h" 3 4 +extern int vdprintf (int __fd, const char *__restrict __fmt, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__printf__, 2, 0))); +extern int dprintf (int __fd, const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + + + + + + + +extern int fscanf (FILE *__restrict __stream, + const char *__restrict __format, ...) ; + + + + +extern int scanf (const char *__restrict __format, ...) ; + +extern int sscanf (const char *__restrict __s, + const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); +# 434 "/usr/include/stdio.h" 3 4 +extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") + + ; +extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") + ; +extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)) + + ; +# 459 "/usr/include/stdio.h" 3 4 +extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__scanf__, 2, 0))) ; + + + + + +extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__format__ (__scanf__, 1, 0))) ; + + +extern int vsscanf (const char *__restrict __s, + const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); + + + + + +extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") + + + + __attribute__ ((__format__ (__scanf__, 2, 0))) ; +extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") + + __attribute__ ((__format__ (__scanf__, 1, 0))) ; +extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__)) + + + + __attribute__ ((__format__ (__scanf__, 2, 0))); +# 513 "/usr/include/stdio.h" 3 4 +extern int fgetc (FILE *__stream); +extern int getc (FILE *__stream); + + + + + +extern int getchar (void); + + + + + + +extern int getc_unlocked (FILE *__stream); +extern int getchar_unlocked (void); +# 538 "/usr/include/stdio.h" 3 4 +extern int fgetc_unlocked (FILE *__stream); +# 549 "/usr/include/stdio.h" 3 4 +extern int fputc (int __c, FILE *__stream); +extern int putc (int __c, FILE *__stream); + + + + + +extern int putchar (int __c); +# 565 "/usr/include/stdio.h" 3 4 +extern int fputc_unlocked (int __c, FILE *__stream); + + + + + + + +extern int putc_unlocked (int __c, FILE *__stream); +extern int putchar_unlocked (int __c); + + + + + + +extern int getw (FILE *__stream); + + +extern int putw (int __w, FILE *__stream); + + + + + + + +extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) + __attribute__ ((__access__ (__write_only__, 1, 2))); +# 632 "/usr/include/stdio.h" 3 4 +extern __ssize_t __getdelim (char **__restrict __lineptr, + size_t *__restrict __n, int __delimiter, + FILE *__restrict __stream) ; +extern __ssize_t getdelim (char **__restrict __lineptr, + size_t *__restrict __n, int __delimiter, + FILE *__restrict __stream) ; + + + + + + + +extern __ssize_t getline (char **__restrict __lineptr, + size_t *__restrict __n, + FILE *__restrict __stream) ; + + + + + + + +extern int fputs (const char *__restrict __s, FILE *__restrict __stream); + + + + + +extern int puts (const char *__s); + + + + + + +extern int ungetc (int __c, FILE *__stream); + + + + + + +extern size_t fread (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; + + + + +extern size_t fwrite (const void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __s); +# 702 "/usr/include/stdio.h" 3 4 +extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; +extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream); + + + + + + + +extern int fseek (FILE *__stream, long int __off, int __whence); + + + + +extern long int ftell (FILE *__stream) ; + + + + +extern void rewind (FILE *__stream); +# 736 "/usr/include/stdio.h" 3 4 +extern int fseeko (FILE *__stream, __off_t __off, int __whence); + + + + +extern __off_t ftello (FILE *__stream) ; +# 760 "/usr/include/stdio.h" 3 4 +extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); + + + + +extern int fsetpos (FILE *__stream, const fpos_t *__pos); +# 786 "/usr/include/stdio.h" 3 4 +extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + +extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + +extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + +extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); +extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; +extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + + +extern void perror (const char *__s); + + + + +extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; +# 823 "/usr/include/stdio.h" 3 4 +extern int pclose (FILE *__stream); + + + + + +extern FILE *popen (const char *__command, const char *__modes) + __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (pclose, 1))) ; + + + + + + +extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__)) + __attribute__ ((__access__ (__write_only__, 1))); +# 867 "/usr/include/stdio.h" 3 4 +extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); +# 885 "/usr/include/stdio.h" 3 4 +extern int __uflow (FILE *); +extern int __overflow (FILE *, int); +# 909 "/usr/include/stdio.h" 3 4 + +# 5 "salut.c" 2 + + +# 6 "salut.c" +int main(void) { + printf("Hello World!\n"); + return +# 8 "salut.c" 3 4 + 0 +# 8 "salut.c" + ; +} diff --git a/BUT1/DEV1.1/Commandes/salut.c b/BUT1/DEV1.1/Commandes/salut.c new file mode 100644 index 0000000..0d8c4f4 --- /dev/null +++ b/BUT1/DEV1.1/Commandes/salut.c @@ -0,0 +1,10 @@ +/* premier programme */ + +#include +#include + +int main(void) { + printf("Hello World!\n"); + return EXIT_SUCCESS; +} + diff --git a/BUT1/DEV1.1/Conditions/billevesees.c b/BUT1/DEV1.1/Conditions/billevesees.c new file mode 100644 index 0000000..caa775b --- /dev/null +++ b/BUT1/DEV1.1/Conditions/billevesees.c @@ -0,0 +1,32 @@ + +#include +#include + +int main(void) +{ + int x = 3; + + if (x == 2) + { + printf("x vaut 2\n"); + } + else + { + printf("x est different de 2\n"); + } + + printf("%d\n", x); + + if (x == 0) + { + printf("x vaut 0\n"); + } + else + { + printf("x est different de 0\n"); + } + + printf("%d\n", x); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Conditions/bissextile1.c b/BUT1/DEV1.1/Conditions/bissextile1.c new file mode 100644 index 0000000..9ab2974 --- /dev/null +++ b/BUT1/DEV1.1/Conditions/bissextile1.c @@ -0,0 +1,31 @@ +#include +#include +int main(void) +{ + int annee; + printf("Saisissez votre année : "); + scanf("%d", &annee); + if (annee % 4 == 0) + { + if (annee % 100 == 0) + { + if (annee % 400 == 0) + { + printf("L'année est bissextile\n"); + } + else + { + printf("L'année est normale\n"); + } + } + else + { + printf("L'année est bissextile\n"); + } + } + else + { + printf("L'année est normale\n"); + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Conditions/bissextile2.c b/BUT1/DEV1.1/Conditions/bissextile2.c new file mode 100644 index 0000000..3b44a1d --- /dev/null +++ b/BUT1/DEV1.1/Conditions/bissextile2.c @@ -0,0 +1,17 @@ +#include +#include +int main(void) +{ + int annee; + printf("Saisissez votre année : "); + scanf("%d", &annee); + if ((annee % 400 == 0) || ((annee % 100 != 0) && (annee % 4 == 0))) + { + printf("L'année est bissextile\n"); + } + else + { + printf("L'année est normale\n"); + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Conditions/ordre.c b/BUT1/DEV1.1/Conditions/ordre.c new file mode 100644 index 0000000..108d6e6 --- /dev/null +++ b/BUT1/DEV1.1/Conditions/ordre.c @@ -0,0 +1,33 @@ +#include +#include + +int main() +{ + int num1, num2, num3; + printf(" Entrez le 1er entier = "); + scanf("%d", &num1); + printf("\n Entrez le 2nd entier = "); + scanf("%d", &num2); + printf("\n Entrez le 3ème entier = "); + scanf("%d", &num3); + if (num1 > num2) + { + if (num1 > num3) + { + printf("\n Plus grand nombre est = %d \n", num1); + } + else + { + printf("\n Plus grand nombre est= %d \n", num3); + } + } + else if (num2 > num3) + { + printf("\n Plus grand nombre est= %d \n", num2); + } + else + { + printf("\n PLus grand nombre est= %d \n", num3); + } + return 0; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Conditions/produit.c b/BUT1/DEV1.1/Conditions/produit.c new file mode 100644 index 0000000..6d53d07 --- /dev/null +++ b/BUT1/DEV1.1/Conditions/produit.c @@ -0,0 +1,24 @@ +#include +#include + +int main(void) +{ + + float nombre = 0; + float nombre2 = 0; + + printf("Rentrez un réel :\n"); + scanf("%f", &nombre); + printf("Rentrez le second réel :\n"); + scanf("%f", &nombre2); + + if ((nombre < 0 && nombre2 < 0) || (nombre > 0 && nombre2 > 0)) + { + + printf("Le résultat est positif"); + } + else + { + printf("Le résultat est négatif"); + } +} diff --git a/BUT1/DEV1.1/Conditions/triple.c b/BUT1/DEV1.1/Conditions/triple.c new file mode 100644 index 0000000..355a9da --- /dev/null +++ b/BUT1/DEV1.1/Conditions/triple.c @@ -0,0 +1,21 @@ +#include +#include +int main(void) +{ + int entier; + int n; + + printf("Entrez un entier naturel :\n"); + scanf("%d", &entier); + + if (entier % 3 == 0) + { + printf("Multiple de 3 : %d\n", entier); + } + if (entier % 3 == 2) + { + printf("Multiple de 3 le plus proche : %d\n", entier + 1); + } + if (entier % 3 == 1) + printf("Multiple de 3 : %d\n", entier - 1); +} diff --git a/BUT1/DEV1.1/Debogueur/1.c b/BUT1/DEV1.1/Debogueur/1.c new file mode 100644 index 0000000..2e5ab83 --- /dev/null +++ b/BUT1/DEV1.1/Debogueur/1.c @@ -0,0 +1,19 @@ +#include +#include + + +int somme(int n, int m) { + return n+m; +} + +int main(void) { + int valeur; + int* p = &valeur; + printf("Entrez un entier : "); + scanf("%d",p); + + printf("Le double vaut %d\n", somme(*p, *p)); + return EXIT_SUCCESS; +} + +/*L'erreur était le NULL après "int* p"*/ \ No newline at end of file diff --git a/BUT1/DEV1.1/Debogueur/2.c b/BUT1/DEV1.1/Debogueur/2.c new file mode 100644 index 0000000..3187fa2 --- /dev/null +++ b/BUT1/DEV1.1/Debogueur/2.c @@ -0,0 +1,20 @@ +#include +#include +#include + +void envers(const char texte[]) { + unsigned position; + for(position = strlen(texte)-1; position >= 0; position--) { + printf("%c", texte[position]); + } + printf("\n"); +} + +int main(int argc, char** argv) { + if (argc < 2) { + printf("usage : %s \n", argv[0]); + return EXIT_FAILURE; + } + envers(argv[1]); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Entiers/arithmetique.c b/BUT1/DEV1.1/Entiers/arithmetique.c new file mode 100644 index 0000000..055043c --- /dev/null +++ b/BUT1/DEV1.1/Entiers/arithmetique.c @@ -0,0 +1,17 @@ +#include +#include + +int main(void) +{ + printf("%d\n", 100 / 6); + printf("%d\n", 100 % 6); + printf("%d\n", 0x1A * 015); + printf("%d\n", -3 / 5); + printf("%d\n", -31 / 5); + printf("%d\n", -31 % 5); + printf("%d\n", 100 * (3 / 5)); + printf("%d\n", 100 * 3 / 5); + printf("%d\n", 2 - 3 - 5); + printf("%d\n", 2 - (3 - 5)); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Entiers/bases.c b/BUT1/DEV1.1/Entiers/bases.c new file mode 100644 index 0000000..cf4a9fc --- /dev/null +++ b/BUT1/DEV1.1/Entiers/bases.c @@ -0,0 +1,10 @@ +#include +#include + +int main(void) +{ + printf("%d\n", 72); + printf("%o\n", 72); + printf("%x\n", 72); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Entiers/multiplication.c b/BUT1/DEV1.1/Entiers/multiplication.c new file mode 100644 index 0000000..6903f76 --- /dev/null +++ b/BUT1/DEV1.1/Entiers/multiplication.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) +{ + printf("%d\n", 73 << 4); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Entiers/operations.c b/BUT1/DEV1.1/Entiers/operations.c new file mode 100644 index 0000000..03104cd --- /dev/null +++ b/BUT1/DEV1.1/Entiers/operations.c @@ -0,0 +1,17 @@ +#include +#include + +int main(void) { + int n = 12; + + printf("%d", (n>>7)&1); + printf("%d", (n>>6)&1); + printf("%d", (n>>5)&1); + printf("%d", (n>>4)&1); + printf("%d", (n>>3)&1); + printf("%d", (n>>2)&1); + printf("%d", (n>>1)&1); + printf("%d", n&1); + printf("\n"); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Entiers/operations2.c b/BUT1/DEV1.1/Entiers/operations2.c new file mode 100644 index 0000000..31e5a55 --- /dev/null +++ b/BUT1/DEV1.1/Entiers/operations2.c @@ -0,0 +1,17 @@ +#include +#include + +int main(void) { + int n = 12|35; + + printf("%d", (n>>7)&1); + printf("%d", (n>>6)&1); + printf("%d", (n>>5)&1); + printf("%d", (n>>4)&1); + printf("%d", (n>>3)&1); + printf("%d", (n>>2)&1); + printf("%d", (n>>1)&1); + printf("%d", n&1); + printf("\n"); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Entiers/operations3.c b/BUT1/DEV1.1/Entiers/operations3.c new file mode 100644 index 0000000..60a5a5a --- /dev/null +++ b/BUT1/DEV1.1/Entiers/operations3.c @@ -0,0 +1,18 @@ +#include +#include + +int main(void) +{ + int n = 12; + + printf("%.32d", (n >> 7) & 1); + printf("%.32d", (n >> 6) & 1); + printf("%.32d", (n >> 5) & 1); + printf("%.32d", (n >> 4) & 1); + printf("%.32d", (n >> 3) & 1); + printf("%.32d", (n >> 2) & 1); + printf("%.32d", (n >> 1) & 1); + printf("%.32d", n & 1); + printf("\n"); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Entiers/reponses.txt b/BUT1/DEV1.1/Entiers/reponses.txt new file mode 100644 index 0000000..f853492 --- /dev/null +++ b/BUT1/DEV1.1/Entiers/reponses.txt @@ -0,0 +1,6 @@ +5) Opérations : + +le programme suivant affiche le nombre 0000 1100 +On peut en déduire que c'est du binaire +le programme suivant a transformé le nombre 12 écrit en décimal (base 10) en nombre binaire (base 2) +Si on remplace 12 par 35 on pour avoir 00100011 diff --git a/BUT1/DEV1.1/Fichier/1.c b/BUT1/DEV1.1/Fichier/1.c new file mode 100644 index 0000000..82be7b1 --- /dev/null +++ b/BUT1/DEV1.1/Fichier/1.c @@ -0,0 +1,22 @@ +#include +#include + +int main(void){ + char sigle[3]; + int score,i; + FILE* fichier; + fichier = fopen("top10","r"); + if(fichier == NULL){ + fputs("ERREUR !",stderr); + }else{ + for(i=0;i<10;i++){ + fread(&score,sizeof(int),1,fichier); + printf("%.9d ",score); + fread(&sigle,sizeof(char),3,fichier); + printf("%.3s\n",sigle); + } + + } + fclose(fichier); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Fichier/2.c b/BUT1/DEV1.1/Fichier/2.c new file mode 100644 index 0000000..d02d295 --- /dev/null +++ b/BUT1/DEV1.1/Fichier/2.c @@ -0,0 +1,31 @@ +#include +#include + +int main(int argc, char* argv[]){ + FILE* fichier; + char sigle[3]; + int score,i; + fichier = fopen("top10","w"); + if(fichier == NULL){ + fputs("ERREUR !",stderr); + }else{ + + } + fclose(fichier); + + + fichier = fopen("top10","r"); + if(fichier == NULL){ + fputs("ERREUR !",stderr); + }else{ + for(i=0;i<10;i++){ + fread(&score,sizeof(int),1,fichier); + printf("%.9d ",score); + fread(sigle,sizeof(char),3,fichier); + printf("%.3s\n",sigle); + } + + } + fclose(fichier); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Fichier/test.c b/BUT1/DEV1.1/Fichier/test.c new file mode 100644 index 0000000..b9e6be9 --- /dev/null +++ b/BUT1/DEV1.1/Fichier/test.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void){ + printf("\33[48;5;196m \33[m"); + printf("\33[48;5;46m \33[m"); + printf("\33[48;5;21m \33[m"); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Fichier/top10 b/BUT1/DEV1.1/Fichier/top10 new file mode 100644 index 0000000..e9d09e4 --- /dev/null +++ b/BUT1/DEV1.1/Fichier/top10 @@ -0,0 +1 @@ +-1770760190 \ No newline at end of file diff --git a/BUT1/DEV1.1/Fonctions/1.txt b/BUT1/DEV1.1/Fonctions/1.txt new file mode 100644 index 0000000..c0314f5 --- /dev/null +++ b/BUT1/DEV1.1/Fonctions/1.txt @@ -0,0 +1,65 @@ +#include +#include + +void triangle(void){ + int h,x,y; + printf("hauteur ? "); + scanf("%d",&h); + for(x=0;x<=h;x++){ + for(y=0;y un compteur + le h c'est hauteur + le c c'est pour faire tourner une boule infini*/ + int x,y,h,c; + char choix; + printf("t) Triangle\nc) Carré\nq) Quitter\nVotre choix : "); + scanf("%c",&choix); + for(c=0;c!=-1;c++){ + if(choix == 't'){ + triangle(); + } + if(choix=='c'){ + carre(); + } + if(choix=='q'){ + quitter(); + return EXIT_SUCCESS; + } + printf("t) Triangle\nc) Carré\nq) Quitter\nVotre choix : "); + scanf(" %c",&choix); + } + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Liste_chainees/circulation.c b/BUT1/DEV1.1/Liste_chainees/circulation.c new file mode 100644 index 0000000..2c5e0b4 --- /dev/null +++ b/BUT1/DEV1.1/Liste_chainees/circulation.c @@ -0,0 +1,83 @@ +#include +#include +#include + +// PROGRAMME D'ALEXIS (A L'AIR FONCTIONNEL) + +typedef struct m{ + int valeur; + struct m* suivant; +} maillon; +void ajoutDebut(maillon** p_liste, int new_valeur){ + maillon* new_maillon = (maillon*) malloc(sizeof(maillon)); + new_maillon->valeur = new_valeur; + new_maillon->suivant = *p_liste; + *p_liste = new_maillon; +} +maillon* creerListe(int taille){ + int i; + int valeur; + maillon* liste = NULL; + for (i=0; isuivant; + free(p_liste); + p_liste=p_suivant; + } +} +void affichage(maillon* liste){ + maillon* addresse=liste; + int i; + while (addresse->suivant!=NULL){ + printf("%hu\n",addresse->valeur); + addresse=addresse->suivant; + } +} +void plusGrand(maillon* liste){ + int plusGrand=0; + maillon* element = liste; + while (element->suivant!=NULL){ + element = element->suivant; + if (element->valeur > plusGrand){ + plusGrand = element->valeur; + } + } + printf("plus grand : %d\n",plusGrand); + +} +void supprDer(maillon* liste){ + if (liste!=NULL){ + if (liste->suivant==NULL){ + free(liste); + liste=NULL; + } + else{ + maillon* p_element = liste; + while ((p_element->suivant)->suivant!=NULL){ + p_element = p_element->suivant; + } + p_element->suivant=NULL; + free(p_element->suivant); + } + } +} +int main(void){ + maillon* liste = NULL; + srand(time(NULL)); + liste = creerListe(10); + affichage(liste); + + supprDer(liste); + + affichage(liste); + plusGrand(liste); + supprListe(liste); + return 0; +} diff --git a/BUT1/DEV1.1/Liste_chainees/maximum.c b/BUT1/DEV1.1/Liste_chainees/maximum.c new file mode 100644 index 0000000..83b4f61 --- /dev/null +++ b/BUT1/DEV1.1/Liste_chainees/maximum.c @@ -0,0 +1,76 @@ +#include +#include +#define TAILLE_LISTE 10 + +typedef struct Element Element; +struct Element +{ + int entier; + Element *suivant; +}; + +int genererRandom(int min, int max) +{ + return min + rand() / (RAND_MAX / (max - min + 1) + 1); +} + +Element *creerListe() +{ + Element *liste = NULL; + for (int i = 0; i < TAILLE_LISTE; i++) + { + Element *nouveauElement = malloc(sizeof(Element)); + nouveauElement->entier = genererRandom(111, 999); + nouveauElement->suivant = liste; + liste = nouveauElement; + } + return liste; +} + +void afficherListe(Element *liste) +{ + if (liste == NULL) + { + exit(EXIT_FAILURE); + } + + while (liste != NULL) + { + printf("%d\n", liste->entier); + liste = liste->suivant; + } + printf("\n"); +} + +int plusGrandElementListe(Element *liste) +{ + int compteur = -1; + while (liste != NULL) + { + if (liste->entier > compteur) + { + compteur = liste->entier; + } + liste = liste->suivant; + } + return compteur; +} + +void supprListe(Element *liste) +{ + Element *suivant = liste; + while (suivant != NULL) + { + suivant = liste->suivant; + free(liste); + liste = suivant; + } +} + +int main(void) +{ + Element *liste = creerListe(); + afficherListe(liste); + printf("\n%d\n", plusGrandElementListe(liste)); + supprListe(liste); +} diff --git a/BUT1/DEV1.1/Listes_chainees_good/1.c b/BUT1/DEV1.1/Listes_chainees_good/1.c new file mode 100644 index 0000000..ce4e13f --- /dev/null +++ b/BUT1/DEV1.1/Listes_chainees_good/1.c @@ -0,0 +1,40 @@ +#include +#include + +struct liste_de_chiffre{ + unsigned short chiffre; + struct liste_de_chiffre* suivant; +}; + +typedef struct liste_de_chiffre maillon; +typedef maillon* liste; + + + +maillon* ajouter_tete(liste t, unsigned short valeur){ + maillon* m = (maillon*) malloc(sizeof(liste)); + m->chiffre = valeur; + m->suivant = t; + return m; +} + +void afficher(maillon* premier) { + maillon* p; + for(p = premier; p != NULL; p = p->suivant) + printf("%hu ", p->chiffre); +} + + +void genere(liste t,int nombre_a_gen){ + int i; + unsigned short valeur_aleatoire = rand(); + for(i=0;i +#include +#include + +int main(void) +{ + double nombrearctan=13; + + printf("La valeur de arctan est :%lf\n" , atan(pow(nombrearctan,2))); + return EXIT_SUCCESS; + + + + +} + + + diff --git a/BUT1/DEV1.1/Maths/Formules/exponentielle.c b/BUT1/DEV1.1/Maths/Formules/exponentielle.c new file mode 100644 index 0000000..a647975 --- /dev/null +++ b/BUT1/DEV1.1/Maths/Formules/exponentielle.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main(void) +{ + double nombre=-1; + + printf("La valeur de l'exponentielle est :%lf\n" , pow(exp(nombre),4)); + return EXIT_SUCCESS; + + + + +} + + + diff --git a/BUT1/DEV1.1/Maths/Formules/formules.c b/BUT1/DEV1.1/Maths/Formules/formules.c new file mode 100644 index 0000000..88614a1 --- /dev/null +++ b/BUT1/DEV1.1/Maths/Formules/formules.c @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(void) +{ + double nombre=0.5; + double nombre2=M_PI; + + printf("%lf => %lf\n" , nombre, sqrt(fabs(log(nombre)))); + return 0; + +} + + + diff --git a/BUT1/DEV1.1/Maths/Formules/logartihme-3.c b/BUT1/DEV1.1/Maths/Formules/logartihme-3.c new file mode 100644 index 0000000..4869a18 --- /dev/null +++ b/BUT1/DEV1.1/Maths/Formules/logartihme-3.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main(void) +{ + double nombre=-3; + + printf("La valeur du logartihme est :%lf\n" , log(nombre)); + return EXIT_SUCCESS; + + + + +} + + + diff --git a/BUT1/DEV1.1/Maths/Formules/racinede2.c b/BUT1/DEV1.1/Maths/Formules/racinede2.c new file mode 100644 index 0000000..7ccd3b1 --- /dev/null +++ b/BUT1/DEV1.1/Maths/Formules/racinede2.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main(void) +{ + double nombre=2; + + printf("La valeur de la racine est :%lf\n" , pow(sqrt(nombre),2)); + return EXIT_SUCCESS; + + + + +} + + + diff --git a/BUT1/DEV1.1/Maths/Formules/sin.c b/BUT1/DEV1.1/Maths/Formules/sin.c new file mode 100644 index 0000000..c86fa8f --- /dev/null +++ b/BUT1/DEV1.1/Maths/Formules/sin.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main(void) +{ + double nombre=M_PI/6; + + printf("La valeur du sinus est :%lf\n" , sin(M_PI/6)); + return EXIT_SUCCESS; + + + + +} + + + diff --git a/BUT1/DEV1.1/Organisation_code/1.c b/BUT1/DEV1.1/Organisation_code/1.c new file mode 100644 index 0000000..acb65b6 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/1.c @@ -0,0 +1,20 @@ +Les prototypes des fonctions exportées : +Exemple : int InitialiserGraphique(); + +Les déclarations des constantes associées : +Exemple : #define _GRAPH_H + #define NB_PIXMAP 10 + +Les déclarations des types associés : +Exemple : typedef unsigned long couleur; + typedef XPoint Point; + +Les directives d inclusion nécessaires : +Exemple : #include + #include + #include + +Les déclarations externes de variables globales : +Exemple : +extern int _X; +extern int _Y; \ No newline at end of file diff --git a/BUT1/DEV1.1/Organisation_code/2.c b/BUT1/DEV1.1/Organisation_code/2.c new file mode 100644 index 0000000..e69de29 diff --git a/BUT1/DEV1.1/Organisation_code/exo1.tar.gz b/BUT1/DEV1.1/Organisation_code/exo1.tar.gz new file mode 100644 index 0000000..e301fdc Binary files /dev/null and b/BUT1/DEV1.1/Organisation_code/exo1.tar.gz differ diff --git a/BUT1/DEV1.1/Organisation_code/exo1/Makefile b/BUT1/DEV1.1/Organisation_code/exo1/Makefile new file mode 100644 index 0000000..7553f89 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/Makefile @@ -0,0 +1,41 @@ +# TP 19 Exercice 1 : fichier Makefile + +# CHAPITRE 1 : BUT FINAL + +but : exo1 + +# CHAPITRE 2 : VARIABLES + +OFILES = lire.o \ + personne.o \ + repertoire.o \ + main.o + +CC = gcc + +CFLAGS = -Wall -ansi -pedantic -g + +# CHAPITRE 3 : DEPENDANCES (REGLES IMPLICITES) + +personne.o : personne.h lire.h + +repertoire.o : repertoire.h personne.h + +main.o : personne.h repertoire.h + +#CHAPITRE 4 : DEPENDANCES AVEC COMMANDES + +lire.o : lire.s lire.h + as -o lire.o lire.s + +exo1 : $(OFILES) + $(CC) $(CFLAGS) -o exo1 $(OFILES) + +#CHAPITRE 5 : NETTOYAGE DES FICHIERS GENERES + +clean : + -rm -f $(OFILES) exo1 + +#CHAPITRE 6 : BUTS FACTICES + +.PHONY : but clean diff --git a/BUT1/DEV1.1/Organisation_code/exo1/exo1 b/BUT1/DEV1.1/Organisation_code/exo1/exo1 new file mode 100755 index 0000000..1b8f68f Binary files /dev/null and b/BUT1/DEV1.1/Organisation_code/exo1/exo1 differ diff --git a/BUT1/DEV1.1/Organisation_code/exo1/lire.h b/BUT1/DEV1.1/Organisation_code/exo1/lire.h new file mode 100644 index 0000000..b3606c5 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/lire.h @@ -0,0 +1,8 @@ +/* TP 19 Exercice 1 : fichier lire.h */ + +#ifndef LIRE_H +#define LIRE_H + +void lire(char*, int); + +#endif /* LIRE_H */ diff --git a/BUT1/DEV1.1/Organisation_code/exo1/lire.s b/BUT1/DEV1.1/Organisation_code/exo1/lire.s new file mode 100644 index 0000000..d4f5f35 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/lire.s @@ -0,0 +1,30 @@ + .section .text + .globl lire + .type lire, @function +lire: +.LFB0: + .cfi_startproc + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + movq %rsp, %rbp + .cfi_def_cfa_register 6 + + xorq %rdx, %rdx + movl %esi, %edx # taille max + movq %rdi, %rsi # adresse chaine + movq $0, %rax # read + movq $0, %rdi # stdin + decq %rdx # place du \0 + syscall # call read + cmpb $10, -1(%rsi, %rax, 1) # si \n + jne lire_1 + decq %rax +lire_1: movb $0, (%rsi, %rax, 1) # place \0 + + popq %rbp + .cfi_def_cfa 7, 8 + ret + .cfi_endproc +.LFE0: + .size lire, .-lire diff --git a/BUT1/DEV1.1/Organisation_code/exo1/main.c b/BUT1/DEV1.1/Organisation_code/exo1/main.c new file mode 100644 index 0000000..e182a76 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/main.c @@ -0,0 +1,42 @@ +/* TP19 Exercice 1 : fichier main.c */ + +#include +#include +#include "personne.h" +#include "repertoire.h" + +typedef enum {AJOUTER, AFFICHER, SORTIR} options; + +options saisir_option() { + short o; + printf("\nChoisissez une option :\n"); + printf("1] Ajouter une personne.\n"); + printf("2] Afficher le repertoire.\n"); + printf("3] Sortir\n"); + printf("? "); + scanf("%hd", &o); + switch(o) { + case 1 : return AJOUTER; + case 2 : return AFFICHER; + case 3 : return SORTIR; + default : return AFFICHER; + } +} + +int main(void) { + options opt; + repertoire r = construire_repertoire(); + while ((opt=saisir_option())!=SORTIR) + switch(opt) { + case AJOUTER : + ajouter_personne(r, saisir_personne()); + break; + case AFFICHER : + afficher_repertoire(r); + break; + default : + ; /* rien a faire */ + } + detruire_repertoire(r); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Organisation_code/exo1/options.c b/BUT1/DEV1.1/Organisation_code/exo1/options.c new file mode 100644 index 0000000..1c41dd9 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/options.c @@ -0,0 +1,15 @@ +options saisir_option() { + short o; + printf("\nChoisissez une option :\n"); + printf("1] Ajouter une personne.\n"); + printf("2] Afficher le repertoire.\n"); + printf("3] Sortir\n"); + printf("? "); + scanf("%hd", &o); + switch(o) { + case 1 : return AJOUTER; + case 2 : return AFFICHER; + case 3 : return SORTIR; + default : return AFFICHER; + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Organisation_code/exo1/options.h b/BUT1/DEV1.1/Organisation_code/exo1/options.h new file mode 100644 index 0000000..0af235f --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/options.h @@ -0,0 +1,5 @@ +#ifndef OPTIONS_H + +/*code*/ + +#endif OPTIONS_H diff --git a/BUT1/DEV1.1/Organisation_code/exo1/personne.c b/BUT1/DEV1.1/Organisation_code/exo1/personne.c new file mode 100644 index 0000000..38195d8 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/personne.c @@ -0,0 +1,33 @@ +/* TP 19 Exercice 1 : fichier personne.c */ + +#include +#include +#include +#include "personne.h" +#include "lire.h" + +personne construire_personne(const char *nom, const char *tel) { + personne p = (personne) malloc(sizeof(struct s_personne)); + strcpy(p->nom, nom); + strcpy(p->tel, tel); + return p; +} + +personne saisir_personne() { + personne p = (personne) malloc(sizeof(struct s_personne)); + printf("\nEntrez le nom de la personne : "); + fflush(stdout); + lire(p->nom, 30); + printf("Entrez son numero de telephone : "); + fflush(stdout); + lire(p->tel, 20); + return p; +} + +void afficher_personne(personne p) { + printf("%-30s %-20s\n", p->nom, p->tel); +} + +void detruire_personne(personne p) { + free(p); +} diff --git a/BUT1/DEV1.1/Organisation_code/exo1/personne.h b/BUT1/DEV1.1/Organisation_code/exo1/personne.h new file mode 100644 index 0000000..079ef3e --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/personne.h @@ -0,0 +1,16 @@ +/* TP 19 Exercice 1 : fichier personne.h */ + +#ifndef PERSONNE_H +#define PERSONNE_H + +typedef struct s_personne { + char nom[30]; + char tel[20]; +} * personne; + +personne construire_personne(const char*, const char*); +personne saisir_personne(); +void afficher_personne(personne); +void detruire_personne(personne); + +#endif /* PERSONNE_H */ diff --git a/BUT1/DEV1.1/Organisation_code/exo1/repertoire.c b/BUT1/DEV1.1/Organisation_code/exo1/repertoire.c new file mode 100644 index 0000000..e31e22a --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/repertoire.c @@ -0,0 +1,37 @@ +/* TP 19 Exercice 1 : fichier repertoire.c */ + +#include +#include +#include "repertoire.h" +#include "lire.h" + +repertoire construire_repertoire() { + repertoire r = (repertoire) malloc(sizeof(struct s_repertoire)); + r->taille = 0; + return r; +} + +void afficher_repertoire(repertoire r) { + int i = 0; + printf("\n%-30s %-20s\n", "Nom", "Telephone"); + for(; itaille; i++) + afficher_personne((r->personnes)[i]); +} + +int ajouter_personne(repertoire r, personne p) { + if (r->taillepersonnes)[r->taille] = p; + (r->taille)++; + return 0; + } else + return 1; +} + +void detruire_repertoire(repertoire r) { + int i = r->taille; + while(i-->0) { + free((r->personnes)[i]); + } + free(r); +} + diff --git a/BUT1/DEV1.1/Organisation_code/exo1/repertoire.h b/BUT1/DEV1.1/Organisation_code/exo1/repertoire.h new file mode 100644 index 0000000..f6db222 --- /dev/null +++ b/BUT1/DEV1.1/Organisation_code/exo1/repertoire.h @@ -0,0 +1,20 @@ +/* TP 19 Exercice 1 : fichier repertoire.h */ + +#ifndef REPERTOIRE_H +#define REPERTOIRE_H + +#include "personne.h" + +#define CAPACITE 100 + +typedef struct s_repertoire { + int taille; + personne personnes[CAPACITE]; +} * repertoire; + +repertoire construire_repertoire(); +void afficher_repertoire(repertoire); +int ajouter_personne(repertoire, personne); +void detruire_repertoire(repertoire); + +#endif /* REPERTOIRE_H */ diff --git a/BUT1/DEV1.1/Recusrivité/1.c b/BUT1/DEV1.1/Recusrivité/1.c new file mode 100644 index 0000000..bac5a3d --- /dev/null +++ b/BUT1/DEV1.1/Recusrivité/1.c @@ -0,0 +1,16 @@ +#include +#include + +void exemple(unsigned n) { + if (n != 0) { + putchar('>'); + exemple(n-1); + putchar('<'); + } else + putchar('O'); +} + +int main(void){ + exemple(4); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Reels/extremites.c b/BUT1/DEV1.1/Reels/extremites.c new file mode 100644 index 0000000..4485391 --- /dev/null +++ b/BUT1/DEV1.1/Reels/extremites.c @@ -0,0 +1,9 @@ +#include +#include +int main(void) +{ + printf("%f\n", +1.0 / 0.0); + printf("%f\n", -1.0 / 0.0); + printf("%f\n", -0.0 / 0.0); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Reels/interets.c b/BUT1/DEV1.1/Reels/interets.c new file mode 100644 index 0000000..48d4228 --- /dev/null +++ b/BUT1/DEV1.1/Reels/interets.c @@ -0,0 +1,19 @@ +#include +#include + +int main(void) +{ + + float argent = 0; + + printf("Combien d'euros souhaitez vous investir ?\n"); + + scanf("%f", &argent); + + for (int i = 1; i < 8; i++) + { + + argent = argent + (argent * 0.04); + printf("Année %d: %f\n", i, argent); + } +} diff --git a/BUT1/DEV1.1/Reels/operations.c b/BUT1/DEV1.1/Reels/operations.c new file mode 100644 index 0000000..5970045 --- /dev/null +++ b/BUT1/DEV1.1/Reels/operations.c @@ -0,0 +1,12 @@ +#include +#include +int main(void) +{ + printf("%f\n", 5.0 + 2.5); + printf("%f\n", 5.0 - 2.5); + printf("%f\n", 5.0 * 2.5); + printf("%f\n", 5.0 / 2.5); + // printf("%f\n", 5.0 % 2.5); // on ne peut pas effectuer de division euclidienne avec un nombre à virgule (un reél) + return EXIT_SUCCESS; +} +// DIVISION AVEC % SEULEMENT POUR DES ENTIERS (INT) \ No newline at end of file diff --git a/BUT1/DEV1.1/Reels/poussieres.c b/BUT1/DEV1.1/Reels/poussieres.c new file mode 100644 index 0000000..6b82c5c --- /dev/null +++ b/BUT1/DEV1.1/Reels/poussieres.c @@ -0,0 +1,7 @@ +#include +#include +int main(void) +{ + printf("%.15f\n", 12345.678910111213); + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Reels/r#U00e9ponses b/BUT1/DEV1.1/Reels/r#U00e9ponses new file mode 100644 index 0000000..162a85d --- /dev/null +++ b/BUT1/DEV1.1/Reels/r#U00e9ponses @@ -0,0 +1,7 @@ +Réels : +1) il faut mettre .12 devant le f pour avoir 12 chiffres après la virgule +2) le % est un opérateur invalide car il est sûrement déjà utilisé au début pour le printf +3) le programme affiche comme résultat : +inf qui veut dire infinité +-inf pareil mais avec un moins vu qu'on a divisé -1 par 0 +-nan signifie non défini car on ne peut pas diviser 0 par 0 diff --git a/BUT1/DEV1.1/Reels/somme1.c b/BUT1/DEV1.1/Reels/somme1.c new file mode 100644 index 0000000..aa5e601 --- /dev/null +++ b/BUT1/DEV1.1/Reels/somme1.c @@ -0,0 +1,21 @@ +#include +#include + +int main(void) +{ + + float nombre1 = 0; + float nombre2 = 0; + float nombre3 = 0; + float nombre4 = 0; + float nombre5 = 0; + + printf("Donne moi 5 nombres réels :\n"); + scanf("%f", &nombre1); + scanf(" %f", &nombre2); + scanf(" %f", &nombre3); + scanf(" %f", &nombre4); + scanf(" %f", &nombre5); + + printf("%f\n ", nombre1 + nombre2 + nombre3 + nombre4 + nombre5); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Reels/somme2.c b/BUT1/DEV1.1/Reels/somme2.c new file mode 100644 index 0000000..ea2818d --- /dev/null +++ b/BUT1/DEV1.1/Reels/somme2.c @@ -0,0 +1,19 @@ +#include +#include + +int main(void) +{ + + double somme = 0; + double saisie = 0; + + for (int i = 1; i <= 5; i++) + { + printf("Séléctionnez le réel n°%d \n", i); + scanf(" %lf", &saisie); + + somme = somme + saisie; + } + + printf("Somme finale : %lf\n", somme); +} diff --git a/BUT1/DEV1.1/Reels/telescopage.c b/BUT1/DEV1.1/Reels/telescopage.c new file mode 100644 index 0000000..92baaed --- /dev/null +++ b/BUT1/DEV1.1/Reels/telescopage.c @@ -0,0 +1,22 @@ +#include +#include + +int main(void) +{ + + float nombre = 0; + char caractere; + printf("Entrez un nombre réel:\n"); + + scanf("%f", &nombre); + printf("Nombre choisi : %e\n", nombre); + + printf("Saisissez un caractère :\n"); + scanf(" %c", &caractere); + + for (int i = 0; i < 5; i++) + { + + printf("Caractère choisi : %c, AFfichage numéro : %d\n", caractere, i + 1); + } +} diff --git a/BUT1/DEV1.1/Structures/1.c b/BUT1/DEV1.1/Structures/1.c new file mode 100644 index 0000000..c2c5f32 --- /dev/null +++ b/BUT1/DEV1.1/Structures/1.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main(void){ + + time_t timestamp = time(NULL); + struct tm * timeInfos = localtime(×tamp); + + printf( "%04d/%02d/%02d\n",timeInfos->tm_year+1900, timeInfos->tm_mon+1, timeInfos->tm_mday); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Structures/2.c b/BUT1/DEV1.1/Structures/2.c new file mode 100644 index 0000000..d52f64d --- /dev/null +++ b/BUT1/DEV1.1/Structures/2.c @@ -0,0 +1,22 @@ +#include +#include + +struct etudiant_s { + char nom; + char prenoms; + int age; +}; + +typedef struct etudiant_s etudiant; + + +int main(void){ + etudiant e = {'M', 'J', 'J'}; + printf("%u",sizeof(e)); + + return EXIT_SUCCESS; +} + + +/* On passe de 3 à 12 quand -> on met 2 char et un int en deuxième => le compilateur prend 3 emplacements de 4 octets dans la mémoire au cas ou, même si elle ne les utilises pas sauf pour le INT + On passe 12 à 8 quand on met int en premier et 2 char après => le compilateur fait partager le bloc de 4 octets dans la mémoire par les deux char*/ diff --git a/BUT1/DEV1.1/Structures/3.c b/BUT1/DEV1.1/Structures/3.c new file mode 100644 index 0000000..afea1f9 --- /dev/null +++ b/BUT1/DEV1.1/Structures/3.c @@ -0,0 +1,10 @@ +#include +#include +#include +#include + + +int main(void){ + struct passwd *reponse = getpwnam("stiti"); + printf("%d\n",reponse->pw_uid); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/TP07-boucles/s#U00e9quencefor.c b/BUT1/DEV1.1/TP07-boucles/s#U00e9quencefor.c new file mode 100644 index 0000000..b713764 --- /dev/null +++ b/BUT1/DEV1.1/TP07-boucles/s#U00e9quencefor.c @@ -0,0 +1,30 @@ +#include +#include +int main(void) +{ + int nombre1 = 0; + int nombre2 = 0; + int i =0; + + printf("Saisissez un nombre entier :\n"); + scanf("%d", &nombre1); + + printf("Saisissez le second nombre :\n"); + scanf(" %d", &nombre2); + + if (nombre1 > nombre2) + { + + printf("Erreur : le premier nombre est supérieur au second. \n"); + } + else + { + + for(i = nombre1; i < nombre2; i++) + + { + + printf("%d\n", i); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Tableaux/maximum.c b/BUT1/DEV1.1/Tableaux/maximum.c new file mode 100644 index 0000000..514f908 --- /dev/null +++ b/BUT1/DEV1.1/Tableaux/maximum.c @@ -0,0 +1,119 @@ +#include +#include +#include +#include +#include + +#define MAX 50 +#define MIN -50 + +int generate_random(int min, int max) +{ + return min + rand() / (RAND_MAX / (max - min + 1) + 1); +} +// GENERE UN NOMBRE ALEATOIRE ENTRE MIN ET MAX +int choix_utilisateur=0; +printf("Entrez le nombre de cases : \n"); +scanf("%d" , choix_utilisateur); + +void affichage_tableau(int tableau[]) +{ + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("+-----+\n"); + } + else + { + + printf("+-----"); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("|%4d |\n", tableau[i]); + } + else + { + + printf("|%4d ", tableau[i]); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + + printf("+-----+\n"); + + else + { + + printf("+-----"); + } + } +} +void affichage_fleche(int numero_case) +{ + for (int i = 0; i < 10; i++) + { + + if (i == numero_case) + { + + printf(" | "); + } + else + { + printf(" "); + } + } + printf("\n"); + for (int i = 0; i < 10; i++) + { + + if (i == numero_case) + { + + printf(" V "); + } + else + { + printf(" "); + } + } + printf("\n"); +} + +int main(void) +{ + int tab[10]; + + srand(time(NULL)); + for (int i = 0; i < 10; i++) + { + tab[i] = generate_random(MIN, MAX); + } + + int nombremax = INT_MIN; // plus petit nombre négatif + int numero_case = -1; + + for (int i = 0; i < 10; i++) + { + if (tab[i] > nombremax) + { + nombremax = tab[i]; + numero_case = i; + } + } + affichage_fleche(numero_case); + affichage_tableau(tab); + + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Tableaux/miroir.c b/BUT1/DEV1.1/Tableaux/miroir.c new file mode 100644 index 0000000..16c9a8f --- /dev/null +++ b/BUT1/DEV1.1/Tableaux/miroir.c @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include + +#define MAX 50 +#define MIN -50 + +int generate_random(int min, int max) +{ + return min + rand() / (RAND_MAX / (max - min + 1) + 1); +} + +void affichage_tableau(int tableau[]) +{ + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("+-----+\n"); + } + else + { + + printf("+-----"); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("|%4d |\n", tableau[i]); + } + else + { + + printf("|%4d ", tableau[i]); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + + printf("+-----+\n"); + + else + { + + printf("+-----"); + } + } +} + +int main(void) +{ + int tab[10]; + + srand(time(NULL)); + for (int i = 0; i < 10; i++) + { + tab[i] = generate_random(MIN, MAX); + } + + affichage_tableau(tab); + + int taille_tableau = 10; + + for (int i = 0; i < taille_tableau / 2; i++) + { + int temp = tab[i]; + tab[i] = tab[taille_tableau - 1 - i]; + tab[taille_tableau - 1 - i] = temp; + } + affichage_tableau(tab); + + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Tableaux/recherche.c b/BUT1/DEV1.1/Tableaux/recherche.c new file mode 100644 index 0000000..a49233e --- /dev/null +++ b/BUT1/DEV1.1/Tableaux/recherche.c @@ -0,0 +1,104 @@ +#include +#include +#include +#include +#include + +#define MAX 50 +#define MIN -50 + +int generate_random(int min, int max) +{ + return min + rand() / (RAND_MAX / (max - min + 1) + 1); +} + +void affichage_tableau(int tableau[]) +{ + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("+-----+\n"); + } + else + { + + printf("+-----"); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("|%4d |\n", tableau[i]); + } + else + { + + printf("|%4d ", tableau[i]); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + + printf("+-----+\n"); + + else + { + + printf("+-----"); + } + } +} + +int main(void) +{ + int tab[10]; + + srand(time(NULL)); + for (int i = 0; i < 10; i++) + { + tab[i] = generate_random(MIN, MAX); + } + + int nombremax = INT_MIN; + int numero_case = -1; + + for (int i = 0; i < 10; i++) + { + if (tab[i] > nombremax) + { + nombremax = tab[i]; + numero_case = i; + } + } + + affichage_tableau(tab); + + int nombre_utilisateur = 0; + int numero_case_utilisateur = -1; + printf("Entrez un numéro présent dans le tableau : "); + scanf("%d", &nombre_utilisateur); + for (int i = 0; i < 10; i++) + { + if (nombre_utilisateur == tab[i]) + { + numero_case_utilisateur = i; + break; + } + } + if (numero_case_utilisateur == -1) + { + printf("Le numéro n'est pas dans le tableau \n"); + } + else + { + printf("Le numéro de case est %d\n ", numero_case_utilisateur); + } + return EXIT_SUCCESS; +} diff --git a/BUT1/DEV1.1/Tableaux/remplissage.c b/BUT1/DEV1.1/Tableaux/remplissage.c new file mode 100644 index 0000000..f5abd9e --- /dev/null +++ b/BUT1/DEV1.1/Tableaux/remplissage.c @@ -0,0 +1,67 @@ +#include +#include +#include +#include + +#define MAX 50 +#define MIN -50 + +int generate_random(int min, int max) +{ + return min + rand() / (RAND_MAX / (max - min + 1) + 1); +} + +int main(void) +{ + int tab[10]; + + srand(time(NULL)); + for (int i = 0; i < 10; i++) + { + tab[i] = generate_random(MIN, MAX); + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("+-----+\n"); + } + else + { + + printf("+-----"); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("|%4d |\n", tab[i]); + } + else + { + + printf("|%4d ", tab[i]); + } + } + + for (int i = 0; i < 10; i++) + { + if (i == 9) + { + + printf("+-----+\n"); + } + else + { + + printf("+-----"); + } + } + + exit(EXIT_SUCCESS); +} diff --git a/BUT1/DEV1.1/Tableaux_multidimensionnels/progressions.c b/BUT1/DEV1.1/Tableaux_multidimensionnels/progressions.c new file mode 100644 index 0000000..ea33399 --- /dev/null +++ b/BUT1/DEV1.1/Tableaux_multidimensionnels/progressions.c @@ -0,0 +1,65 @@ +#include +#include + +#define ROW_T1 2 // ROW = ligne = à mettre entre les premiers crochets +#define COLUMN_T1 5 // COLMUN = colonne = à mettre entre les seconds crochets +#define ROW_T2 3 +#define COLUMN_T2 5 +#define ROW_T3 5 +#define COLUMN_T3 5 +// PROGRAMME T1 +int main(void) +{ + int tab1[ROW_T1][COLUMN_T1]; + + for (int i = 0; i < ROW_T1; i++) + { + + for (int j = 0; j < COLUMN_T1; j++) + { + + tab1[i][j] = j + 1; + + printf("%d ", tab1[i][j]); + } + printf("\n"); + } + printf("\n"); + + int tab2[ROW_T2][COLUMN_T2]; + int compteur = 1; + + for (int i = 0; i < ROW_T2; i++) + { + + for (int j = 0; j < COLUMN_T2; j++) + { + + tab2[i][j] = compteur; + compteur = compteur + 1; + + printf("%d ", tab2[i][j]); + } + printf("\n"); + } + printf("\n"); + + int tab3[ROW_T3][COLUMN_T3]; + for (int i = 0; i < ROW_T3; i++) + { + for (int j = 0; j < COLUMN_T3; j++) + { + if (j < i) + { + tab3[i][j] = j + 1; + } + else + { + tab3[i][j] = 0; + } + + printf("%d ", tab3[i][j]); + } + printf("\n"); + } +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Types/affluence.c b/BUT1/DEV1.1/Types/affluence.c new file mode 100644 index 0000000..960c950 --- /dev/null +++ b/BUT1/DEV1.1/Types/affluence.c @@ -0,0 +1,21 @@ +#include +#include + +int main(void) +{ + int lundi = 0, mardi = 0, mercredi = 0, jeudi = 0, vendredi = 0; + double moyenne = 0; + printf("Le nombre de visiteurs lundi est : "); + scanf("%d", &lundi); + printf("Le nombre de visiteurs mardi est : "); + scanf(" %d", &mardi); + printf("Le nombre de visiteurs mercredi est : "); + scanf(" %d", &mercredi); + printf("Le nombre de visiteurs jeudi est : "); + scanf(" %d", &jeudi); + printf("Le nombre de visiteurs vendredi est : "); + scanf(" %d", &vendredi); + moyenne = ((double)lundi + (double)mardi + (double)mercredi + (double)jeudi + (double)vendredi) / 5; + + printf("Le nombre de moyen de visiteurs est : %lf\n", moyenne); +} \ No newline at end of file diff --git a/BUT1/DEV1.1/Types/debordement.c b/BUT1/DEV1.1/Types/debordement.c new file mode 100644 index 0000000..30561ec --- /dev/null +++ b/BUT1/DEV1.1/Types/debordement.c @@ -0,0 +1,18 @@ +#include +#include +#include + +int main (void) +{ + int nombre=0; + signed char caractere=0; + printf("Choisissez un nombre entier : "); + scanf("%d", &nombre); + caractere=nombre; + printf("%hhd\n", caractere); + return EXIT_SUCCESS; + + +} + + diff --git a/BUT1/DEV1.1/Types/variete.c b/BUT1/DEV1.1/Types/variete.c new file mode 100644 index 0000000..b7711a1 --- /dev/null +++ b/BUT1/DEV1.1/Types/variete.c @@ -0,0 +1,26 @@ +#include +#include +#include + +int main (void) +{ + signed char nombre=77; + unsigned char nombre2=77; + short int nombre3=77; + unsigned short int nombre4=77; + int nombre5=77; + unsigned int nombre6=77; + long int nombre7=77; + unsigned long int nombre8=77; + long long int nombre9=77; + unsigned long long int nombre10=77; + + + printf("%hhd,%hhu,%hd,%hu,%d,%u,%ld,%lu,%lld,%llu\n" , nombre,nombre2,nombre3,nombre4,nombre5,nombre6,nombre7,nombre8,nombre9,nombre10); + + + + +} + + diff --git a/BUT1/DEV1.1/fichier(suite)/1.c b/BUT1/DEV1.1/fichier(suite)/1.c new file mode 100644 index 0000000..ac85afb --- /dev/null +++ b/BUT1/DEV1.1/fichier(suite)/1.c @@ -0,0 +1,23 @@ +#include +#include + +int main(void){ + FILE* fichier; + int i = 0; + int reponse; + fichier = fopen("sauvegarde.txt","r"); + if(fichier != NULL){ + reponse = fscanf(fichier,"%d",&i); + fclose(fichier); + } + i++; + + fichier = fopen("sauvegarde.txt","w"); + if(fichier != NULL){ + fprintf(fichier,"%d",i); + fclose(fichier); + } + printf("%d\n",i); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/fichier(suite)/2.c b/BUT1/DEV1.1/fichier(suite)/2.c new file mode 100644 index 0000000..4391f53 --- /dev/null +++ b/BUT1/DEV1.1/fichier(suite)/2.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main(void){ + FILE* fichier; + fichier = fopen("image.bin","r"); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/fichier(suite)/image b/BUT1/DEV1.1/fichier(suite)/image new file mode 100644 index 0000000..d2ac982 Binary files /dev/null and b/BUT1/DEV1.1/fichier(suite)/image differ diff --git a/BUT1/DEV1.1/fichier(suite)/image.bin b/BUT1/DEV1.1/fichier(suite)/image.bin new file mode 100644 index 0000000..d67e8de Binary files /dev/null and b/BUT1/DEV1.1/fichier(suite)/image.bin differ diff --git a/BUT1/DEV1.1/fichier(suite)/sauvegarde.txt b/BUT1/DEV1.1/fichier(suite)/sauvegarde.txt new file mode 100644 index 0000000..105d7d9 --- /dev/null +++ b/BUT1/DEV1.1/fichier(suite)/sauvegarde.txt @@ -0,0 +1 @@ +100 \ No newline at end of file diff --git a/BUT1/DEV1.1/hello_world b/BUT1/DEV1.1/hello_world new file mode 100755 index 0000000..d2ce5a3 Binary files /dev/null and b/BUT1/DEV1.1/hello_world differ diff --git a/BUT1/DEV1.1/revision/boucle-table.c b/BUT1/DEV1.1/revision/boucle-table.c new file mode 100644 index 0000000..6a681f5 --- /dev/null +++ b/BUT1/DEV1.1/revision/boucle-table.c @@ -0,0 +1,13 @@ +#include +#include + +int main(void){ + int table_choisie,i; + printf("entrez un entier : "); + scanf("%d",&table_choisie); + for(i=1;i<=10;i++){ + printf("5 x %2d = %3d\n",i,i*5); + } + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/revision/carre.c b/BUT1/DEV1.1/revision/carre.c new file mode 100644 index 0000000..111db88 --- /dev/null +++ b/BUT1/DEV1.1/revision/carre.c @@ -0,0 +1,40 @@ +#include + +int main() { + int base1, base2, hauteur; + + printf("Entrez la longueur de la base du haut du trapèze : "); + scanf("%d", &base1); + + printf("Entrez la longueur de la base du bas du trapèze : "); + scanf("%d", &base2); + + printf("Entrez la hauteur du trapèze : "); + scanf("%d", &hauteur); + + for (int i = 1; i <= hauteur; i++) { + for (int j = 1; j <= base1; j++) { + if (i == hauteur || j == 1 || j == base1) { + printf("* "); + } else { + printf(" "); + } + } + + for (int j = 1; j <= base2 - base1; j++) { + printf(" "); + } + + for (int j = 1; j <= base2; j++) { + if (i == hauteur || j == 1 || j == base2) { + printf("* "); + } else { + printf(" "); + } + } + + printf("\n"); + } + + return 0; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/revision/cercle.c b/BUT1/DEV1.1/revision/cercle.c new file mode 100644 index 0000000..4baf704 --- /dev/null +++ b/BUT1/DEV1.1/revision/cercle.c @@ -0,0 +1,23 @@ +#include +#include + +int main() { + int rayon; + int i, j; + + printf("Rayon ? "); + scanf("%d", &rayon); + + for (i = -rayon; i <= rayon; i++) { + for (j = -rayon; j <= rayon; j++) { + if (i * i + j * j <= rayon * rayon) { + printf("* "); + } else { + printf(" "); + } + } + printf("\n"); + } + + return 0; +} \ No newline at end of file diff --git a/BUT1/DEV1.1/test.c b/BUT1/DEV1.1/test.c new file mode 100644 index 0000000..746e0bf --- /dev/null +++ b/BUT1/DEV1.1/test.c @@ -0,0 +1,12 @@ +#include +#include + +int main() +{ + InitialiserGraphique(); + CreerFenetre(10,10,500,500); + EcrireTexte(10,100,"Hello World !",2); + Touche(); + FermerGraphique(); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/BUT1/DEV1.2/TP1/exo0.html b/BUT1/DEV1.2/TP1/exo0.html new file mode 100644 index 0000000..f2d9e29 --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo0.html @@ -0,0 +1,17 @@ + + + + + Moncef est un génie ! + + +

My first HTML5 document

+ +

Le W3C est un consortium crée le par Tim

+ + + + + + + \ No newline at end of file diff --git a/BUT1/DEV1.2/TP1/exo1.html b/BUT1/DEV1.2/TP1/exo1.html new file mode 100644 index 0000000..53a783a --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo1.html @@ -0,0 +1,18 @@ + + + + + Le wikipédia du W3C + + +

Le W3C

+ +

Le W3C est un consortium crée le + par Tim Berners-Lee, principal inventeur du World Wide Web en , + pour promouvoir la compatibilité et donc la normalisation des technologies du World Wide Web. + Avant le W3C, c'était l'IETF, un autre organisme + important de l'Internet, qui était en charge de cette mission.

+ +

Le W3C a par exemple standardisé les technologies HTML et XML

+ + diff --git a/BUT1/DEV1.2/TP1/exo2.html b/BUT1/DEV1.2/TP1/exo2.html new file mode 100644 index 0000000..144f5bd --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo2.html @@ -0,0 +1,32 @@ + + + + + Le wikipédia des emoticons + + +

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/BUT1/DEV1.2/TP1/exo3.html b/BUT1/DEV1.2/TP1/exo3.html new file mode 100644 index 0000000..6d72969 --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo3.html @@ -0,0 +1,15 @@ + + + + + Le blog de moncef le bg + + +

Mes sites préférées :

+
    - YouTube
    Ce site me permet de regarder des vidéos de mathématiques et m'as permis d'avoir 6/20 en maths au lieu de 0/20 ! C'est vraiment génial !
+
    - IUT FBLEAU
    Ce site me permet de trouver tout mes TP de dev très facilement !
+ + + + + diff --git a/BUT1/DEV1.2/TP1/exo4/exo4.html b/BUT1/DEV1.2/TP1/exo4/exo4.html new file mode 100644 index 0000000..e54fab4 --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo4/exo4.html @@ -0,0 +1,25 @@ + + + + + Le wikipédia des planètes + + +

+ + + + + + + + + + + +
PlanèteDistance moyenne (UA)Exentricité Inclinaison  (°)Période de révolution (an)Photo
Venus0,723331990,0073,40,615
Jupiter5,203363010,0491,311,862
Mars1,523662310,0941,91,881
Saturne9,60,0572,529,452
Mercure0,387098930,20570,241
Neptune4495,11,828,359,8
Terre10,01701
Uranus2872,50,897,830,589
+ + + + + diff --git a/BUT1/DEV1.2/TP1/exo4/image/Neptune.jpg b/BUT1/DEV1.2/TP1/exo4/image/Neptune.jpg new file mode 100644 index 0000000..c5284fb Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/Neptune.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/jupiter.jpg b/BUT1/DEV1.2/TP1/exo4/image/jupiter.jpg new file mode 100644 index 0000000..9625337 Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/jupiter.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/mars.jpg b/BUT1/DEV1.2/TP1/exo4/image/mars.jpg new file mode 100644 index 0000000..e43cace Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/mars.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/mercure.jpg b/BUT1/DEV1.2/TP1/exo4/image/mercure.jpg new file mode 100644 index 0000000..28d12f3 Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/mercure.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/saturne.jpg b/BUT1/DEV1.2/TP1/exo4/image/saturne.jpg new file mode 100644 index 0000000..b920cae Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/saturne.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/terre.jpg b/BUT1/DEV1.2/TP1/exo4/image/terre.jpg new file mode 100644 index 0000000..44c403d Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/terre.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/uranus.jpg b/BUT1/DEV1.2/TP1/exo4/image/uranus.jpg new file mode 100644 index 0000000..4777900 Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/uranus.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo4/image/venus.jpg b/BUT1/DEV1.2/TP1/exo4/image/venus.jpg new file mode 100644 index 0000000..8c5b5d4 Binary files /dev/null and b/BUT1/DEV1.2/TP1/exo4/image/venus.jpg differ diff --git a/BUT1/DEV1.2/TP1/exo5.html b/BUT1/DEV1.2/TP1/exo5.html new file mode 100644 index 0000000..6a1cc2d --- /dev/null +++ b/BUT1/DEV1.2/TP1/exo5.html @@ -0,0 +1,17 @@ + + + + + Le blog de moncef le bg + + + Planets + + + Sun + Mercury + Venus +``` + + diff --git a/BUT1/DEV1.2/TP1/img.png b/BUT1/DEV1.2/TP1/img.png new file mode 100644 index 0000000..f3c78e1 Binary files /dev/null and b/BUT1/DEV1.2/TP1/img.png differ diff --git a/BUT1/DEV1.2/TP2/EXO1/exo1.html b/BUT1/DEV1.2/TP2/EXO1/exo1.html new file mode 100644 index 0000000..4e1ac45 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO1/exo1.html @@ -0,0 +1,23 @@ + + + + + Exercice 1 + + + + +

Mon article de blog

+

Ma première partie

+

ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut

+ +

Ma deuxième partie

+

ut ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut

+ + + + diff --git a/BUT1/DEV1.2/TP2/EXO1/exo1_p3.html b/BUT1/DEV1.2/TP2/EXO1/exo1_p3.html new file mode 100644 index 0000000..6a08466 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO1/exo1_p3.html @@ -0,0 +1,14 @@ + + + + + Exercice 1 + + + + +

Ma troisième partie

+

ut ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio utut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut lectus arcu bibendum at varius vel pharetra vel turpis nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque convallis a cras semper auctor neque vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget nullam non nisi est sit amet facilisis magna etiam tempor orci eu lobortis elementum nibh tellus molestie nunc non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat est velit egestas dui id ornare arcu odio ut

+ + + diff --git a/BUT1/DEV1.2/TP2/EXO2/exo2.html b/BUT1/DEV1.2/TP2/EXO2/exo2.html new file mode 100644 index 0000000..b875172 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO2/exo2.html @@ -0,0 +1,62 @@ + + + + + Exercice 1 + + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ Homme
+ Femme + + +

+
+ +
+
+ +

+
+ + +
+ + + + + + + + +
+ + + + + diff --git a/BUT1/DEV1.2/TP2/EXO3/exo3.html b/BUT1/DEV1.2/TP2/EXO3/exo3.html new file mode 100644 index 0000000..eee6e51 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO3/exo3.html @@ -0,0 +1,80 @@ + + + + + Exercice 1 + + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ Homme
+ Femme + + +

+
+ +
+
+ +

+
+ + +
+ +
+ + + + + \ No newline at end of file diff --git a/BUT1/DEV1.2/TP2/EXO4/exo4.css b/BUT1/DEV1.2/TP2/EXO4/exo4.css new file mode 100644 index 0000000..c552e31 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO4/exo4.css @@ -0,0 +1,20 @@ +body { + font-family:sans-serif; +} + +h1 { + font-variant:small-caps; + text-decoration : underline; +} + +h2 { + background-color:#ca3d3d; + padding : 10px; + font-style:italic; +} + +span { + font-family: monospace; + font-weight:bold; + color : #ff5500; +} \ No newline at end of file diff --git a/BUT1/DEV1.2/TP2/EXO4/exo4.html b/BUT1/DEV1.2/TP2/EXO4/exo4.html new file mode 100644 index 0000000..c8810d1 --- /dev/null +++ b/BUT1/DEV1.2/TP2/EXO4/exo4.html @@ -0,0 +1,55 @@ + + + + + + + + + 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/BUT1/DEV1.2/TP4/EXO1/exo1.css b/BUT1/DEV1.2/TP4/EXO1/exo1.css new file mode 100644 index 0000000..b9fff4a --- /dev/null +++ b/BUT1/DEV1.2/TP4/EXO1/exo1.css @@ -0,0 +1,82 @@ +header { + + grid-column : 1 / span 2; + grid-row : 1 / 1; + } + section { + grid-column : 1 / 1; + grid-row : 2 / 2; + display : grid; + grid-template-columns: 1fr 1fr; + grid-template-rows :auto 1fr 1fr; + + } + nav ul { + + display : flex; + justify-content: space-around; + } + + header h2 { + + text-align: center; + background-color: lightgrey; + + } + nav ul li { + flex-basis : auto; + + display : inline-block; + } + section > h2 { + + grid-column : 1 / 3; + grid-row : 1 / 2; + text-align:center; + } + aside { + padding-left : 0.25em; + + } + article { + + border : 1px solid gray; + padding : 0.25em; + margin : 0.25em; + } + article:nth-of-type(1){ + + grid-column : 1 / 1; + grid-row : 2 / 2; + } + article:nth-of-type(2){ + + grid-column : 2 / 2; + grid-row : 2 / 2; + } + article:nth-of-type(3){ + + grid-column : 1 / 1; + grid-row : 3 / 3; + } + article:nth-of-type(4){ + + grid-column : 2 / 2; + grid-row : 3 / 3; + } + + aside { + + grid-column : 2 / 2; + grid-row : 2 / 2; + } + footer { + + grid-column : 1 / 2; + grid-row : 3 / 3; + } + body{ + display: grid; + grid-template-columns: 2fr 1fr; + grid-template-rows : auto 1fr auto; + } \ No newline at end of file diff --git a/BUT1/DEV1.2/TP4/EXO1/exo1.html b/BUT1/DEV1.2/TP4/EXO1/exo1.html new file mode 100644 index 0000000..45361fc --- /dev/null +++ b/BUT1/DEV1.2/TP4/EXO1/exo1.html @@ -0,0 +1,82 @@ + + + + + + TP mise en page avec le css + + + +
+

Mon Panthéon

+ +
+
+

Les informaticiens

+
+ Ritchie +

Dennis
Ritchie

+

9 septembre 1941 - 12 octobre 2011

Nationalité : américaine

+
+
+ linus torvalds +

Linus
Torvalds

+

28 décembre 1969 -

+

Nationalité : finlandaise

+
+
+ Pascal +

Blaise
Pascal

+

19 juin 1623 - 19 août 1662

+

Nationalité : française

+
+
+ turing +

Alan
Turing

+

23 juin 1912 - 7 juin 1954

+

Nationalité : britannique

+
+
+ + + + diff --git a/BUT1/DEV1.2/TP5/index.html b/BUT1/DEV1.2/TP5/index.html new file mode 100644 index 0000000..8e426f9 --- /dev/null +++ b/BUT1/DEV1.2/TP5/index.html @@ -0,0 +1,43 @@ + + + + + + + Jeu de la vie + + + + + + + + + +

+ Génération numéro: | Taille de la grille: | Timer : +

+
+ +
+ + + + diff --git a/BUT1/DEV1.2/TP5/script.js b/BUT1/DEV1.2/TP5/script.js new file mode 100644 index 0000000..6001d9a --- /dev/null +++ b/BUT1/DEV1.2/TP5/script.js @@ -0,0 +1,225 @@ +// --------------------------------------------------------------------- +// --------------------------------------------------------------------- + +/** + * Cette partie du code, vous n'avez pas besoin d'y toucher. Elle permet + * de gérer la grille et l'affichage des cellules + */ + +let gridSize=prompt("Choisis la taille frero",15); +parseInt(gridSize,10); + +class GridManager { + ACTIVE_COLOR = 'black'; + INACTIVE_COLOR = 'grey'; + gridContainerId; + gridSize; + grid = []; + + constructor(gridSize, gridContainerId) { + if (!gridSize || gridSize < 30) { + throw new Error('The grid size must be at least 30'); + } + + if (!gridContainerId) { + throw new Error('gridContainerId must be set'); + } + + this.gridSize = gridSize; + this.gridContainerId = gridContainerId; + this.createGrid(); + } + + createGrid() { + const container = document.getElementById(this.gridContainerId); + + for (let i = 0; i < this.gridSize; i++) { + const row = document.createElement('div'); + row.className = 'row'; + + const gridRow = []; + + for (let j = 0; j < this.gridSize; j++) { + const cell = document.createElement('div'); + cell.className = 'cell'; + cell.style.backgroundColor = this.INACTIVE_COLOR; + row.appendChild(cell); + + gridRow.push(cell); + } + + container.appendChild(row); + this.grid.push(gridRow); + } + } + + destroyGrid() { + for (let x = 0; x < this.gridSize; x++) { + for (let y = 0; y < this.gridSize; y++) { + const node = this.grid[y][x]; + node.parentNode.removeChild(node); + } + } + + const container = document.getElementById(this.gridContainerId); + while (container.firstChild) { + container.removeChild(container.lastChild); + } + + this.grid = []; + } + + setInitialState(initialState) { + const coords = initialState.split(';').map(coord => coord.split(',')); + coords.forEach((coord) => this.activeCell(+coord[0], +coord[1])); + } + + isInGridRange(x, y) { + return x >= 0 && x < this.gridSize && y >= 0 && y < this.gridSize; + } + + isActiveCell(x, y) { + return this.isInGridRange(x, y) && this.grid[y][x].style.backgroundColor === this.ACTIVE_COLOR; + } + + activeCell(x, y) { + if (!this.isInGridRange(x, y)) { + return; + } + + this.grid[y][x].style.backgroundColor = this.ACTIVE_COLOR; + } + + deactiveCell(x, y) { + if (!this.isInGridRange(x, y)) { + return; + } + + this.grid[y][x].style.backgroundColor = this.INACTIVE_COLOR; + } + + getNumberActiveNeighbourCells(x, y) { + const neighbours = [ + [x-1, y-1], [x, y-1], [x+1, y-1], + [x-1, y], [x+1, y], + [x-1, y+1], [x, y+1], [x+1, y+1], + ]; + + return neighbours.map(cell => this.isActiveCell(cell[0], cell[1])).filter(cell => cell === true).length; + } + + logCurrentGridState() { + const activeCells = []; + + for (let x = 0; x < this.gridSize; x++) { + for (let y = 0; y < this.gridSize; y++) { + if (this.isActiveCell(x, y)) { + activeCells.push(`${x},${y}`); + } + } + } + + console.log(activeCells.join(';')); + } +} + + +// --------------------------------------------------------------------- +// --------------------------------------------------------------------- + + +const INITIAL_STATE = '11,1;12,1;10,2;9,3;9,4;9,5;10,6;11,7;12,7;2,4;1,5;2,5;18,28;17,28;19,27;20,26;20,25;20,24;19,23;18,22;17,22;27,25;28,24;27,24;11,28;12,28;10,27;9,26;9,25;9,24;10,23;11,22;12,22;2,25;1,24;2,24;18,1;17,1;19,2;20,3;20,4;20,5;19,6;18,7;17,7;27,4;28,5;27,5'; +const GENERATION_INTERVAL = 1000; // 1 seconde +const DIV_CONTAINER_ID = 'container'; +const BTN_AUTOPLAY_ID = 'autoplay'; +const BTN_NEXT_GEN_ID = 'next-gen'; +const BTN_REST_ID = 'reset'; +const GENERATION_VAL_ID = 'generation-value'; +const GRID_SIZE_VAL_ID = 'grid-size-value'; + +function computeNextGeneration(gridManager, generation) { + + // incrémenter la valeur de la génération et l'afficher à côté de 'Génération numéro:' + + const nextGrid = []; + + for (let x = 0; x < gridManager.gridSize; x++) { + const row = []; + for (let y = 0; y < gridManager.gridSize; y++) { + const isActive = gridManager.isActiveCell(x, y); + const numberActiveNeighbourCells = gridManager.getNumberActiveNeighbourCells(x, y); + + if (!isActive) { + row.push(numberActiveNeighbourCells === 3 ? true : false); + } else { + row.push(numberActiveNeighbourCells === 2 || numberActiveNeighbourCells === 3 ? true : false); + } + } + + nextGrid.push(row); + } + + for (let x = 0; x < nextGrid.length; x++) { + for (let y = 0; y < nextGrid[x].length; y++) { + nextGrid[x][y] ? gridManager.activeCell(x,y) : gridManager.deactiveCell(x,y); + } + } + + gridManager.logCurrentGridState(); + return generation; +} + +// Fonction principale du jeu + +function main() { + let autoplayInterval; + let gridSize = 30; + let generation = 0; + + let gridManager = new GridManager(gridSize, DIV_CONTAINER_ID); + gridManager.setInitialState(INITIAL_STATE); + + // Lorsqu'un utilisateur clique sur 'Auto Play' + document.getElementById(BTN_AUTOPLAY_ID).addEventListener('click', () => { + if (autoplayInterval) { + return; + } + + var timer; + var ele = document.getElementById('timer'); + + (function(){ + var sec = 0; + timer = setInterval(()=>{ + ele.innerHTML = " "+sec+"s"; + sec ++; + },1000) + })() + + autoplayInterval = setInterval(() => { + generation = computeNextGeneration(gridManager); + }, GENERATION_INTERVAL); + }); + + // Lorsqu'un utilisateur clique sur 'Prochaine Génération' + document.getElementById(BTN_NEXT_GEN_ID).addEventListener('click', () => { + if (autoplayInterval) { + clearInterval(autoplayInterval); + autoplayInterval = null; + } + + computeNextGeneration(gridManager); + }); + + document.getElementById(BTN_REST_ID).addEventListener('click',() =>{ + clearInterval(autoplayInterval); + gridManager.destroyGrid(); + gridManager.createGrid(); + gridManager.setInitialState(INITIAL_STATE); + }) +} + + +// Le jeu est démarré ici + +main(); diff --git a/BUT1/DEV1.3/EXO3/css.svg b/BUT1/DEV1.3/EXO3/css.svg new file mode 100644 index 0000000..550e2e0 --- /dev/null +++ b/BUT1/DEV1.3/EXO3/css.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/BUT1/DEV1.3/EXO3/exo3.css b/BUT1/DEV1.3/EXO3/exo3.css new file mode 100644 index 0000000..e69de29 diff --git a/BUT1/DEV1.3/EXO3/exo3.html b/BUT1/DEV1.3/EXO3/exo3.html new file mode 100644 index 0000000..ec40fdd --- /dev/null +++ b/BUT1/DEV1.3/EXO3/exo3.html @@ -0,0 +1,15 @@ + + + + + Exercice 3 + + + + + + diff --git a/BUT1/DEV1.3/EXO3/html.svg b/BUT1/DEV1.3/EXO3/html.svg new file mode 100644 index 0000000..dd81b76 --- /dev/null +++ b/BUT1/DEV1.3/EXO3/html.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/BUT1/DEV1.3/EXO3/js.svg b/BUT1/DEV1.3/EXO3/js.svg new file mode 100644 index 0000000..79aa7d7 --- /dev/null +++ b/BUT1/DEV1.3/EXO3/js.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/BUT1/DEV1.3/exo1.css b/BUT1/DEV1.3/exo1.css new file mode 100644 index 0000000..938c6d4 --- /dev/null +++ b/BUT1/DEV1.3/exo1.css @@ -0,0 +1,17 @@ +li:nth-child(2n){ +background-color:grey; +list-style-type:none; +padding-left:5px; +margin-right: 70%; +margin-bottom: 5px; +} + +li:nth-child(2n+1){ + background-color:rgb(191, 191, 191); + font-style:italic; + list-style-type:none; + padding-left:5px; + margin-right: 70%; + margin-bottom: 5px; +} + \ No newline at end of file diff --git a/BUT1/DEV1.3/exo1.html b/BUT1/DEV1.3/exo1.html new file mode 100644 index 0000000..b1b16f8 --- /dev/null +++ b/BUT1/DEV1.3/exo1.html @@ -0,0 +1,24 @@ + + + + + Exercice 1 + + + + +

Mes films préférés de Clint Eastwood

+
    +
  • Gran Torino (2008)
  • +
  • Impitoyable (1992)
  • +
  • Mystic River (2003)
  • +
  • Sur la route de Madison (1995)
  • +
  • Lettres d'Iwo Jima (2006)
  • +
  • L'Échange (2008)
  • +
  • Josey Wales hors-la-loi (1976)
  • +
  • Breezy (1973)
  • +
+ + + + diff --git a/BUT1/DEV1.3/exo2.css b/BUT1/DEV1.3/exo2.css new file mode 100644 index 0000000..db3c12c --- /dev/null +++ b/BUT1/DEV1.3/exo2.css @@ -0,0 +1,41 @@ +main{ + position: absolute; + width: 400px; + height: 400px; + border-radius: 50px; + left: 500px; + top: 200px; + background-color:yellow; + border-style: solid; + border-width: 8px; + border-color:red; +} + +header{ + position: relative; + top: 100px; + left:70px; + width: 100px; + height: 100px; + border-radius: 50px; + background-color:blue; +} + +section{ + position: relative; + top: 0px; + left:230px; + width: 100px; + height: 100px; + border-radius: 50px; + background-color:blue; +} + +aside{ + position: relative; + top: 60px; + left:70px; + width: 250px; + height: 60px; + background-color:red; +} \ No newline at end of file diff --git a/BUT1/DEV1.3/exo2.html b/BUT1/DEV1.3/exo2.html new file mode 100644 index 0000000..d27eb3e --- /dev/null +++ b/BUT1/DEV1.3/exo2.html @@ -0,0 +1,16 @@ + + + + + Exercice 2 + + + +
+
+
+ + +
+ + diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 1 /Bonjour.java b/BUT1/DEV2.2/TP1-Introduction/EXO 1 /Bonjour.java new file mode 100644 index 0000000..ab95b0b --- /dev/null +++ b/BUT1/DEV2.2/TP1-Introduction/EXO 1 /Bonjour.java @@ -0,0 +1,17 @@ +/** +* Cette classe est une simple coquille pour recevoir la méthode principale +* +* @version 1.1 09 March 2014 +* @author Luc Hernandez +*/ +public class Bonjour { + + /** + * Affiche «Bonjour !» + * + * @param args la liste des arguments de la ligne de commande (inutilisée ici) + */ + public static void main(String[] args) { + System.out.println("Bonjour !"); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 1 /exo1.java b/BUT1/DEV2.2/TP1-Introduction/EXO 1 /exo1.java new file mode 100644 index 0000000..590fe19 --- /dev/null +++ b/BUT1/DEV2.2/TP1-Introduction/EXO 1 /exo1.java @@ -0,0 +1,33 @@ +/** +* Cette classe est une simple coquille pour recevoir la méthode principale +* +* @version 1.1 09 March 2014 +* @author Luc Hernandez +*/ +public class exo1 { + + /** + * Affiche «Bonjour !» + * + * @param args la liste des arguments de la ligne de commande (inutilisée ici) + */ + public static void main(String[] args) { + byte moncefleboss1 = 1; + short moncefleboss2 = 1; + int moncefleboss3 = 1; + long moncefleboss4 = 1; + boolean moncefleboss5 = false; + char moncefleboss6 = 'Y'; + float moncefleboss7 = -1.5f; + double moncefleboss8 = 47.0d; + + System.out.println("Valeur : " + moncefleboss1); + System.out.println("Valeur : " + moncefleboss2); + System.out.println("Valeur : " + moncefleboss3); + System.out.println("Valeur : " + moncefleboss4); + System.out.println("Valeur : " + moncefleboss5); + System.out.println("Valeur : " + moncefleboss6); + System.out.println("Valeur : " + moncefleboss7); + System.out.println("Valeur : " + moncefleboss8); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.class b/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.class new file mode 100644 index 0000000..84229e1 Binary files /dev/null and b/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.class differ diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.java b/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.java new file mode 100644 index 0000000..c165feb --- /dev/null +++ b/BUT1/DEV2.2/TP1-Introduction/EXO 2/Exo2.java @@ -0,0 +1,14 @@ +/** + * Ici aussi il faut écrire des choses + */ + +public class Exo2 { + /** + * Ceci est une documentation + */ + public static void main(String[] args){ + for(String i : args){ + System.out.println("Bonjour " + i); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.class b/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.class new file mode 100644 index 0000000..fbdda2b Binary files /dev/null and b/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.class differ diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.java b/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.java new file mode 100644 index 0000000..6538f52 --- /dev/null +++ b/BUT1/DEV2.2/TP1-Introduction/EXO 3/exo3.java @@ -0,0 +1,17 @@ +/** + * DOC + */ + +public class exo3 { + /** + * DOC + */ + public static void main(String[] args){ + int resultat = 0; + for(String i : args){ + int nombreTemporaire = Integer.parseInt(i); + resultat += nombreTemporaire; + } + System.out.println("La somme est : " + resultat); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.class b/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.class new file mode 100644 index 0000000..c92a715 Binary files /dev/null and b/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.class differ diff --git a/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.java b/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.java new file mode 100644 index 0000000..1f456e4 --- /dev/null +++ b/BUT1/DEV2.2/TP1-Introduction/EXO 4/exo4.java @@ -0,0 +1,24 @@ +import java.util.Arrays; + +/** + * DOC + */ + +public class exo4 { + /** + * DOC + */ + public static void main(String[] args){ + int[] tableauDeInt = new int[args.length]; + int index = 0; + for(String valeur : args){ + int nombreTemporaire = Integer.parseInt(valeur); + tableauDeInt[index] = nombreTemporaire; + index++; + } + Arrays.sort(tableauDeInt); + for(int j = 0; j