From 7021891e9c54a8aa64d11ebf8836fc5b47efb8e8 Mon Sep 17 00:00:00 2001 From: meliani~ Date: Wed, 8 Feb 2023 11:18:16 +0100 Subject: [PATCH] vgsfjij --- .gitignore | 2 ++ DEV1.1/CM1/calculs.c | 27 ++++++++++++++ DEV1.1/CM1/cases.c | 26 ++++++++++++++ DEV1.1/CM1/chaton.c | 8 +++++ DEV1.1/CM1/comptes.c | 47 +++++++++++++++++++++++++ DEV1.1/CM1/constante.c | 13 +++++++ DEV1.1S/CM/MakeFile | 8 +++++ DEV1.1S/CM/exo1.c | 17 +++++++++ DEV1.1S/CM/exo1.h | 7 ++++ DEV1.1S/CM/exo2.c | 20 +++++++++++ DEV1.1S/CM/exo3.c | 22 ++++++++++++ DEV1.1S/CM/fonction.c | 13 +++++++ DEV1.1S/CM/fonction.h | 6 ++++ DEV1.1S/CM/meliani_CM2.tar.gz | Bin 0 -> 927 bytes DEV1.1S/CM3/recherche.c | 44 +++++++++++++++++++++++ DEV1.1S/CM3/recoupement.c | 29 +++++++++++++++ DEV1.1S/CM3/reduction.c | 26 ++++++++++++++ DEV1.1S/CM3/stack.c | 60 ++++++++++++++++++++++++++++++++ DEV1.1S/CM3/stack.h | 22 ++++++++++++ DEV1.1S/Controle_Blanc/Exo1.c | 18 ++++++++++ DEV1.1S/Controle_Blanc/Exo2.c | 46 ++++++++++++++++++++++++ DEV1.1S/Controle_Blanc/Exo3.c | 12 +++++++ DEV1.1S/Controle_Blanc/mail.txt | 1 + DEV1.1S/TP01/Palindromes.c | 30 ++++++++++++++++ DEV1.1S/TP01/singleton.c | 43 +++++++++++++++++++++++ DEV1.1S/TP02/complexes.c | 22 ++++++++++++ DEV1.1S/TP02/date.c | 14 ++++++++ DEV1.1S/TP02/groupe.c | 14 ++++++++ DEV1.1S/TP02/tailles.c | 15 ++++++++ DEV1.1S/TP03/challenger.c | 59 +++++++++++++++++++++++++++++++ DEV1.1S/TP03/records.c | 27 ++++++++++++++ DEV1.1S/TP03/top10 | Bin 0 -> 70 bytes DEV1.1S/TPLC/exo1.c | 42 ++++++++++++++++++++++ DEV1.1S/TPLC/exo2.c | 42 ++++++++++++++++++++++ DEV1.1S/TPLC/test.c | 52 +++++++++++++++++++++++++++ DEV1.1S/TPPILE/chainee.c | 44 +++++++++++++++++++++++ DEV1.1S/TPPILE/chainee_tables.c | 47 +++++++++++++++++++++++++ DEV1.1S/TPPILE/file.c | 34 ++++++++++++++++++ DEV1.1S/TPREC/exo2.c | 0 DEV1.1S/TPREC/fibonacci.c | 13 +++++++ DEV1.1S/TPREC/tableau.c | 17 +++++++++ DEV2.1/TP01/Bonjour.class | Bin 0 -> 955 bytes DEV2.1/TP01/Bonjour.java | 27 ++++++++++++++ DEV2.1/TP01/Grille.class | Bin 0 -> 578 bytes DEV2.1/TP01/Grille.java | 10 ++++++ DEV2.1/TP01/Somme.class | Bin 0 -> 576 bytes DEV2.1/TP01/Somme.java | 10 ++++++ DEV2.1/TP01/exo2.class | Bin 0 -> 664 bytes DEV2.1/TP01/exo2.java | 7 ++++ DEV2.1/TP01/tri.class | Bin 0 -> 857 bytes DEV2.1/TP01/tri.java | 14 ++++++++ DEV2.1/TP02/Boutons.class | Bin 0 -> 1044 bytes DEV2.1/TP02/Boutons.java | 42 ++++++++++++++++++++++ DEV2.1/TP02/Choix.class | Bin 0 -> 958 bytes DEV2.1/TP02/Choix.java | 36 +++++++++++++++++++ DEV2.1/TP02/Saisie.class | Bin 0 -> 1013 bytes DEV2.1/TP02/Saisie.java | 26 ++++++++++++++ DEV2.1/TP02/Sirocco.class | Bin 0 -> 751 bytes DEV2.1/TP02/Sirocco.java | 21 +++++++++++ DEV2.1/TP03/Choix.java | 36 +++++++++++++++++++ 60 files changed, 1218 insertions(+) create mode 100644 DEV1.1/CM1/calculs.c create mode 100644 DEV1.1/CM1/cases.c create mode 100644 DEV1.1/CM1/chaton.c create mode 100644 DEV1.1/CM1/comptes.c create mode 100644 DEV1.1/CM1/constante.c create mode 100644 DEV1.1S/CM/MakeFile create mode 100644 DEV1.1S/CM/exo1.c create mode 100644 DEV1.1S/CM/exo1.h create mode 100644 DEV1.1S/CM/exo2.c create mode 100644 DEV1.1S/CM/exo3.c create mode 100644 DEV1.1S/CM/fonction.c create mode 100644 DEV1.1S/CM/fonction.h create mode 100644 DEV1.1S/CM/meliani_CM2.tar.gz create mode 100644 DEV1.1S/CM3/recherche.c create mode 100644 DEV1.1S/CM3/recoupement.c create mode 100644 DEV1.1S/CM3/reduction.c create mode 100644 DEV1.1S/CM3/stack.c create mode 100644 DEV1.1S/CM3/stack.h create mode 100644 DEV1.1S/Controle_Blanc/Exo1.c create mode 100644 DEV1.1S/Controle_Blanc/Exo2.c create mode 100644 DEV1.1S/Controle_Blanc/Exo3.c create mode 100644 DEV1.1S/Controle_Blanc/mail.txt create mode 100644 DEV1.1S/TP01/Palindromes.c create mode 100644 DEV1.1S/TP01/singleton.c create mode 100644 DEV1.1S/TP02/complexes.c create mode 100644 DEV1.1S/TP02/date.c create mode 100644 DEV1.1S/TP02/groupe.c create mode 100644 DEV1.1S/TP02/tailles.c create mode 100644 DEV1.1S/TP03/challenger.c create mode 100644 DEV1.1S/TP03/records.c create mode 100644 DEV1.1S/TP03/top10 create mode 100644 DEV1.1S/TPLC/exo1.c create mode 100644 DEV1.1S/TPLC/exo2.c create mode 100644 DEV1.1S/TPLC/test.c create mode 100644 DEV1.1S/TPPILE/chainee.c create mode 100644 DEV1.1S/TPPILE/chainee_tables.c create mode 100644 DEV1.1S/TPPILE/file.c create mode 100644 DEV1.1S/TPREC/exo2.c create mode 100644 DEV1.1S/TPREC/fibonacci.c create mode 100644 DEV1.1S/TPREC/tableau.c create mode 100644 DEV2.1/TP01/Bonjour.class create mode 100644 DEV2.1/TP01/Bonjour.java create mode 100644 DEV2.1/TP01/Grille.class create mode 100644 DEV2.1/TP01/Grille.java create mode 100644 DEV2.1/TP01/Somme.class create mode 100644 DEV2.1/TP01/Somme.java create mode 100644 DEV2.1/TP01/exo2.class create mode 100644 DEV2.1/TP01/exo2.java create mode 100644 DEV2.1/TP01/tri.class create mode 100644 DEV2.1/TP01/tri.java create mode 100644 DEV2.1/TP02/Boutons.class create mode 100644 DEV2.1/TP02/Boutons.java create mode 100644 DEV2.1/TP02/Choix.class create mode 100644 DEV2.1/TP02/Choix.java create mode 100644 DEV2.1/TP02/Saisie.class create mode 100644 DEV2.1/TP02/Saisie.java create mode 100644 DEV2.1/TP02/Sirocco.class create mode 100644 DEV2.1/TP02/Sirocco.java create mode 100644 DEV2.1/TP03/Choix.java diff --git a/.gitignore b/.gitignore index 3417814..97d8f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,5 @@ tags # Persistent undo [._]*.un~ +DEV1.1/meliani_CM1.tar.gz +DEV1.1S/meliani_CM3.tar.gz diff --git a/DEV1.1/CM1/calculs.c b/DEV1.1/CM1/calculs.c new file mode 100644 index 0000000..7cec12a --- /dev/null +++ b/DEV1.1/CM1/calculs.c @@ -0,0 +1,27 @@ +#include +#include +#include +int main(void){ + int NOMBRE = 5; + double CIBLE = 51.7; + double tab[NOMBRE]; + int i; + double res = 100000; + int proche = 0; + for(i = 0; i< NOMBRE; i++){ + printf("Entrez une valeur : "); + scanf("%lf", &tab[i]); + printf("case n° %d : ", i); + printf("%.2lf\n", tab[i]); + } + res = fabs(tab[0] - CIBLE); + for(i = 1; i < NOMBRE; i++){ + if (fabs(tab[i] - CIBLE) <= res){ + res = fabs(tab[i] - CIBLE); + proche = i; + } + } + printf("La valeur la plus proche est dans la case n° %d\n", proche); + return 0; +} + \ No newline at end of file diff --git a/DEV1.1/CM1/cases.c b/DEV1.1/CM1/cases.c new file mode 100644 index 0000000..c7951d6 --- /dev/null +++ b/DEV1.1/CM1/cases.c @@ -0,0 +1,26 @@ +#include +#include +int main(void){ + int cases; + int i; + int a; + printf("Entrez le nombre de cases : "); + scanf("%d", &cases); + if (cases > 0){ + printf("┌──"); + for(i=0; i < cases-1; i++){ + printf("┬──"); + } + printf("┐\n"); + for(i=0; i <= cases; i++){ + printf("│ "); + } + printf("\n"); + printf("└──"); + for(i=0; i< cases-1; i++){ + printf("┴──"); + } + printf("┘\n"); + } + return 0; +} \ No newline at end of file diff --git a/DEV1.1/CM1/chaton.c b/DEV1.1/CM1/chaton.c new file mode 100644 index 0000000..eca136e --- /dev/null +++ b/DEV1.1/CM1/chaton.c @@ -0,0 +1,8 @@ +#include +#include +int main(void){ + printf(" (\\_/)\n"); + printf("=(^.^)=\n"); + printf("(\")_(\")"); + return 0; +} \ No newline at end of file diff --git a/DEV1.1/CM1/comptes.c b/DEV1.1/CM1/comptes.c new file mode 100644 index 0000000..e07c8ba --- /dev/null +++ b/DEV1.1/CM1/comptes.c @@ -0,0 +1,47 @@ +#include +#include +int main(void){ + int argent; + int livre = 0; + int deniers = 0; + int sous = 0; + printf("Combien de deniers ? \n"); + scanf("%d", &argent); + while (argent >= 240){ + livre++; + argent = argent-240; + } + while (argent >=12){ + sous++; + argent = argent-12; + } + while (argent >= 1){ + deniers++; + argent = argent-1; + } + if(livre != 0 && livre == 1){ + printf("%d", livre); + printf(" livre\n"); + } + if(livre > 1){ + printf("%d", livre); + printf(" livres\n"); + } + if(sous != 0 && sous == 1){ + printf("%d", sous); + printf(" sou\n"); + } + if(sous > 1){ + printf("%d", sous); + printf(" sous\n"); + } + if(deniers != 0 && deniers == 1){ + printf("%d", deniers); + printf(" denier"); + } + if(deniers > 1){ + printf("%d", deniers); + printf(" deniers"); + } + return 0; +} \ No newline at end of file diff --git a/DEV1.1/CM1/constante.c b/DEV1.1/CM1/constante.c new file mode 100644 index 0000000..86446f3 --- /dev/null +++ b/DEV1.1/CM1/constante.c @@ -0,0 +1,13 @@ +#include +#include +int main(void){ + char a = (char) '9'; + printf("%c\n", a); + long int b = 9L; + printf("%ld\n", b); + long double c = 9.0L; + printf("%.0Lf\n", c); + int d = 0x9; + printf("%d\n", d); + return 0; +} \ No newline at end of file diff --git a/DEV1.1S/CM/MakeFile b/DEV1.1S/CM/MakeFile new file mode 100644 index 0000000..a905706 --- /dev/null +++ b/DEV1.1S/CM/MakeFile @@ -0,0 +1,8 @@ +exo1 : fonction.o exo1.o + gcc -o exo1 fonction.o exo1.o + +fonction.o : fonction.c fonction.h + gcc -c fonction.c + +exo.o : exo1.c exo1.h + gcc -c exo1.c \ No newline at end of file diff --git a/DEV1.1S/CM/exo1.c b/DEV1.1S/CM/exo1.c new file mode 100644 index 0000000..d712938 --- /dev/null +++ b/DEV1.1S/CM/exo1.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]){ + double tab[10]; + int i; + for(i=1; i +#include + +int main(int argc, char *argv[]){ + FILE* fichier1, fichier2; + char tab1, tab2; + int diff; + fichier1 = fopen($argv[1], "r"); + fichier2 = fopen($argv[2], "r") + while(diff != 0){ + fread(&tab1, sizeof(char), 1, fichier1) + fread(&tab2, sizeof(char), 1, fichier2) + if (strcmp(tab2,tab1) != 0;){ + diff = 1; + } + } + fclose(fichier1); + fclose(fichier2); + return 0; +} diff --git a/DEV1.1S/CM/exo3.c b/DEV1.1S/CM/exo3.c new file mode 100644 index 0000000..af38e92 --- /dev/null +++ b/DEV1.1S/CM/exo3.c @@ -0,0 +1,22 @@ +#include +#include +#include +int main(int argc, char *argv[]){ + struct timespec temps; + + printf("E"); + temps.tv_nsec; + printf("R"); + temps.tv_nsec; + printf("R"); + temps.tv_nsec; + + printf("E"); + temps.tv_nsec; + + printf("U"); + temps.tv_nsec; + + printf("R"); + return 0 +} \ No newline at end of file diff --git a/DEV1.1S/CM/fonction.c b/DEV1.1S/CM/fonction.c new file mode 100644 index 0000000..b422d34 --- /dev/null +++ b/DEV1.1S/CM/fonction.c @@ -0,0 +1,13 @@ +#include +#include +#include +int valnull(double* tab, int taille){ + int i; + int accumulateur = 0; + for(i=0; iv>4B(SuDF3z5-vrqA0He2Py$J+JNQ^*h-&2YX)5qVakyetG{AqDJ&tjBB6#O87 zbdiB*dMQj(>8{_(%Ry=XukEdGe`i12ge9QtoBM1pOD2#=vM}tXe({kFZ&;a zF@TIq>dm;@_%CYy{QQTpsQ-y=EB-fvC-PrXec^Clmn07FX&=c`z&_kR+)M={PtVRz z_L0l!oU;)3^E(2x%nuA8g>RDO0yrqRg8!KZqysltGGBi!W8!Hab;3@supo~tNM@n6 zzs;e5)kQq?3Nl2RAKZ{RGyP3EY{Y-Cz?CPLULO^+!@a60*=$OrsYppt9MZ*7m*ygT zPmVfChi%JgWa%i&M=te(i0SJwCyzx$h_b9@Hkqm<|E=Bf-?rEFzcnO8@_%G1{x^YV z@BcAhuzc^|k`RC<357xcJfbC|C}xXgG|{y7G6W}A@0>_>OR*6@-1-rtlS2FH`Pwa^ z3-$G%)oJjYkJ@V2t5hE(|8af2KY^|NKWvrye^~N=h!y{vz`Fl;@&2sR`^%oU@;q<( zX{x&ZACd8Yr~Ch~`2Ppwc3S`2ivLaE+57*(iRYU;0#7Lm(oTUm2;5+EIw|@CX(IrO zMu6}v+5qzOe~710RYOe?2Qytp<52%!UZ0Y-^L7QO zQD085S1Ky@X5i@@;<5}pSQ17^xUoo_Hg-{`D<~)^C@3f>C@B05`~m~f8V3L<008Qx B)b{`Y literal 0 HcmV?d00001 diff --git a/DEV1.1S/CM3/recherche.c b/DEV1.1S/CM3/recherche.c new file mode 100644 index 0000000..48fa77b --- /dev/null +++ b/DEV1.1S/CM3/recherche.c @@ -0,0 +1,44 @@ +#include +#include +int rechercheValeur(int valeur, int* tableau, int taille){ + int n= -1; + if (taille == 0){ + if (valeur == tableau[taille]){ + n = taille; + } + return n; + } + if (valeur == tableau[taille]){ + n = taille; + return n; + } + return rechercheValeur(valeur, tableau , taille-1); +} +int main(int argc, char const *argv[]) +{ + int test, test1, test2, test3, test4; + int oui = 5; + int tab1[5] = {3, 7 ,4 ,8, 9}; + int tab2[5] = {6, 7 ,4 ,8, 9}; + int tab3[5] = {2, 7 ,4 ,8, 6}; + int tab4[5] = {6, 7 ,6 ,6, 9}; + test = rechercheValeur(6, tab1 , oui); + test2 = rechercheValeur(6, tab2, oui); + test3 = rechercheValeur(6, tab3, oui); + test4 = rechercheValeur(6, tab4, oui); + + printf("Test vide : "); + printf("%d\n", test); + + printf("Test 1 fois au début : "); + printf("%d\n", test2); + + printf("Test 1 fois a la fin : "); + printf("%d\n", test3); + + printf("Test 3 fois au total : "); + printf("%d\n", test4); + + + return 0; +} diff --git a/DEV1.1S/CM3/recoupement.c b/DEV1.1S/CM3/recoupement.c new file mode 100644 index 0000000..24cd304 --- /dev/null +++ b/DEV1.1S/CM3/recoupement.c @@ -0,0 +1,29 @@ +#include +#include +int main(int argc, char const *argv[]) +{ + int* chiffres; + int valeur; + int arret = 0; + int accumulateur = 0; + int i; + chiffres = (int*) malloc(100*sizeof(int)); + while(arret == 0){ + for(i=0; i<= accumulateur; i++){ + if ((chiffres[accumulateur] / chiffres[i]) == 2){ + arret == 1; + printf("Perdu)"); + i == 100000000; + } + + } + if (arret != 1){ + printf("Entrez une valeur : "); + scanf("%d", valeur); + chiffres[accumulateur] == valeur; + } + +} + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1S/CM3/reduction.c b/DEV1.1S/CM3/reduction.c new file mode 100644 index 0000000..9626ddb --- /dev/null +++ b/DEV1.1S/CM3/reduction.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +void sans_zero(stack pile){ + int stock; + while (empty(pile) == 0){ + stock = pop(pile); + if(stock != 0){ + push(pile, stock) + } + + } +} +int main(int argc, char const *argv[]) +{ + int pile = create_stack() + int push = push(pile, 1); + push = push(pile , 2); + push = push(pile , 0); + push = push(pile , 1); + push = push(pile , 0); + sans_zero(pile); + return 0; +} \ No newline at end of file diff --git a/DEV1.1S/CM3/stack.c b/DEV1.1S/CM3/stack.c new file mode 100644 index 0000000..6321919 --- /dev/null +++ b/DEV1.1S/CM3/stack.c @@ -0,0 +1,60 @@ +#include +#include "stack.h" + +struct s_link { + unsigned value; + struct s_link *next; +}; + +typedef struct s_link link; + +struct s_stack { + link *first; +}; + + +/* crée une pile vide */ +stack create_stack(void) { + return (stack) calloc(1, sizeof(struct s_stack)); +} + +/* ajoute un élément à la pile. Renvoie 1 en cas de succès */ +int push(stack the_stack, unsigned the_value) { + link *new = (link*) malloc(sizeof(link)); + if (new == NULL) { + return 0; + } + new->value = the_value; + new->next = the_stack->first; + the_stack->first = new; + return 1; +} + +/* renvoie 1 si la pile est vide */ +int empty(stack the_stack) { + return the_stack->first == NULL; +} + +/* retire un élément de la pile. Renvoie l'élément retiré, ou -1 en cas d'échec */ +long pop(stack the_stack) { + if(the_stack->first == NULL) { + return -1; + } + link l = *(the_stack->first); + free(the_stack->first); + the_stack->first = l.next; + return l.value; +} + +/* détruit une pile en libérant les ressources associées */ +void destroy_stack(stack the_stack) { + link *current, *saved; + + current = the_stack->first; + while(current != NULL) { + saved = current->next; + free(current); + current = saved; + } + free(the_stack); +} \ No newline at end of file diff --git a/DEV1.1S/CM3/stack.h b/DEV1.1S/CM3/stack.h new file mode 100644 index 0000000..81897ac --- /dev/null +++ b/DEV1.1S/CM3/stack.h @@ -0,0 +1,22 @@ +#ifndef STACK_H +#define STACK_H + +/* le type stack représente une pile */ +typedef struct s_stack *stack; + +/* crée une pile vide. Renvoie NULL en cas d'échec */ +stack create_stack(void); + +/* ajoute un élément à la pile. Renvoie 0 en cas d'échec */ +int push(stack, unsigned); + +/* renvoie 1 si la pile est vide */ +int empty(stack); + +/* retire un élément de la pile. Renvoie l'élément retiré, ou -1 en cas d'échec */ +long pop(stack); + +/* détruit une pile en libérant les ressources associées */ +void destroy_stack(stack); + +#endif /* STACK_H */ \ No newline at end of file diff --git a/DEV1.1S/Controle_Blanc/Exo1.c b/DEV1.1S/Controle_Blanc/Exo1.c new file mode 100644 index 0000000..61fdd29 --- /dev/null +++ b/DEV1.1S/Controle_Blanc/Exo1.c @@ -0,0 +1,18 @@ +#include +#include +#include +int main(int argc, char const *argv[]) +{ + if (strcmp(argv[2], "cm") == 0){ + double val =strtod(argv[1], NULL); + val = val / 2.54; + printf("%.2lf%s", val,"in"); + + } + if (strcmp(argv[2], "in") == 0){ + double val = strtod(argv[1], NULL); + val = val*2.54; + printf("%.2lf%s",val,"cm"); + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1S/Controle_Blanc/Exo2.c b/DEV1.1S/Controle_Blanc/Exo2.c new file mode 100644 index 0000000..5480d91 --- /dev/null +++ b/DEV1.1S/Controle_Blanc/Exo2.c @@ -0,0 +1,46 @@ +#include +#include +#include +#include +int main(int argc, char const *argv[]){ + int date; + int mois; + int annee; + printf("Entrez une date : "); + scanf("%d", &date); + scanf("%d", &mois); + scanf("%d", &annee); + struct tm jour; + jour.tm_sec = 0; + jour.tm_min = 0; + jour.tm_hour = 0; + jour.tm_mday = date; + jour.tm_mon = mois; + jour.tm_year = annee; + printf("%d\n", jour.tm_wday); + if (jour.tm_wday == 0){ + printf("c'est un dimanche"); + } + if (jour.tm_wday == 1){ + printf("c'est un lundi"); + } + if (jour.tm_wday == 2){ + printf("c'est un mardi"); + } + if (jour.tm_wday == 3){ + printf("c'est un mercredi"); + } + if (jour.tm_wday == 4){ + printf("c'est un jeudi"); + } + if (jour.tm_wday == 5){ + printf("c'est un vendredi"); + } + if (jour.tm_wday == 6){ + printf("c'est un samedi"); + } + + + + return 0; +} \ No newline at end of file diff --git a/DEV1.1S/Controle_Blanc/Exo3.c b/DEV1.1S/Controle_Blanc/Exo3.c new file mode 100644 index 0000000..9a40f80 --- /dev/null +++ b/DEV1.1S/Controle_Blanc/Exo3.c @@ -0,0 +1,12 @@ +#include +#include +#include +int main (void){ + FILE* fichier; + fichier = fopen("dev/random", "r"); + int tab[2]; + fread(&tab[0],sizeof(int),1,fichier); + printf("%d\n", tab[0]); + fclose(fichier); + return 0; +} \ No newline at end of file diff --git a/DEV1.1S/Controle_Blanc/mail.txt b/DEV1.1S/Controle_Blanc/mail.txt new file mode 100644 index 0000000..97171c4 --- /dev/null +++ b/DEV1.1S/Controle_Blanc/mail.txt @@ -0,0 +1 @@ +marie-helene.renaud@u-pec.fr diff --git a/DEV1.1S/TP01/Palindromes.c b/DEV1.1S/TP01/Palindromes.c new file mode 100644 index 0000000..f94acf7 --- /dev/null +++ b/DEV1.1S/TP01/Palindromes.c @@ -0,0 +1,30 @@ +#include +#include +#include + +char* inverse(const char* s){ + int i; + int e=0; + char* crocs; + int longueur = (int) strlen(s); + crocs = (char*) malloc(longueur+1); + for (i=longueur-1;i>=0;--i) { + crocs[e] = s[i]; + e++; + crocs[longueur] = '\0'; + } + return crocs; +} + +int main(int argc, char** argv) { + int c; + for(c=1; c< argc; c++){ + if (strcmp(argv[c], inverse(argv[c]))== 0){ + printf("est un palindrome \n"); + } + else{ + printf("non \n"); + } + } + return 0; +} \ No newline at end of file diff --git a/DEV1.1S/TP01/singleton.c b/DEV1.1S/TP01/singleton.c new file mode 100644 index 0000000..7ea745e --- /dev/null +++ b/DEV1.1S/TP01/singleton.c @@ -0,0 +1,43 @@ +#include +#include +int main(void){ + float* tab; + int i = 0; + int a; + int fin = 0; + int lin = 2; + int valeur; + tab = (float*) malloc(2*sizeof(float)); + printf("Donnez une réponse : "); + valeur = scanf("%f", &tab[i]); + if(valeur == 1){ + i++; + } + while(valeur != 1){ + printf("Donnez une valeur : "); + valeur = scanf("%f", tab[i]); + if (valeur == 1 ){ + i++; + } + if (i%2 == 0){ + lin = lin +2; + tab = (float*) realloc(tab, lin); + } + int taille = strlen(tab); + } + for(i=0;i +#include +#include +int main(void){ + struct crocs{ + double x; + double y; + double i = sqrt(-1); + double z = x+y*i; + } + double val1; + double val2; + double res; + double eee; + printf("Donnez une valeur : "); + scanf("%f", &val1); + printf("Donnez une deuxième valeur : "); + scanf("%f", &val2); + struct crocs cars = {val1;val2;eee;res} + printf("%f", res); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1S/TP02/date.c b/DEV1.1S/TP02/date.c new file mode 100644 index 0000000..171c2f3 --- /dev/null +++ b/DEV1.1S/TP02/date.c @@ -0,0 +1,14 @@ +#include +#include +#include +int main(void){ + time_t temps= time(NULL); + struct tm* date = localtime(&temps); + printf("%d", date->tm_year+1900); + printf("-"); + printf("%d", date->tm_mon+1); + printf("-"); + printf("%d\n", date->tm_mday); + return EXIT_SUCCESS; +} + diff --git a/DEV1.1S/TP02/groupe.c b/DEV1.1S/TP02/groupe.c new file mode 100644 index 0000000..2a68fa6 --- /dev/null +++ b/DEV1.1S/TP02/groupe.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include +#include +int main(void){ + int i = 0; + struct group* groupe = getgrnam("students22"); + while(groupe->gr_mem[i] != NULL){ + printf("%s", groupe->gr_mem[i]); + i++; + } + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1S/TP02/tailles.c b/DEV1.1S/TP02/tailles.c new file mode 100644 index 0000000..faabdb1 --- /dev/null +++ b/DEV1.1S/TP02/tailles.c @@ -0,0 +1,15 @@ +#include +#include +int main(void){ + struct tailles{ + char* a; + char* b; + char* c; + }; + struct tailles chaine = {"e","ab","c"}; + int res = sizeof(chaine); + printf("%d\n", res); + return EXIT_SUCCESS; +} + + \ No newline at end of file diff --git a/DEV1.1S/TP03/challenger.c b/DEV1.1S/TP03/challenger.c new file mode 100644 index 0000000..a6a7f29 --- /dev/null +++ b/DEV1.1S/TP03/challenger.c @@ -0,0 +1,59 @@ +#include +#include +#include +int main(void){ + FILE* fichier; + fichier = fopen("top10", "r"); + int tab[10]; + char oui[30]; + int i; + int a; + int alt = 4; + for(i=0; i<10; i++){ + fread(&tab[i], sizeof(int), 1,fichier); + fread(&oui[i*3], 1, 3, fichier); + } + for(i=0; i<10;i++){ + printf("%9d ", tab[i]); + printf("%c", oui[i*3]); + printf("%c", oui[i*3+1]); + printf("%c\n", oui[i*3+2]); + } + fclose(fichier); + int score; + char pseudo; + int emplacement; + printf("Donnez un score : "); + scanf("%7d", &score); + printf("Donnez un pseudo : "); + scanf("%c", &pseudo); + if(strlen(pseudo) != 3){ + scanf("%c", &pseudo); + } + + for(i=0; i<10; i++){ + if (score > tab[i]){ + emplacement = i; + i =10; + } + } + for(i=10; i>=emplacement; i--){ + tab[i] == tab[i]+1; + } + tab[emplacement] = score; + emplacement = emplacement+3; + for(i=30; i<= emplacement; i--){ + oui[i] == oui[i+3]; + } + for(i=0; i<3; i++){ + oui[emplacement] == pseudo[i]; + emplacement++; + } + printf("%d",tab); + printf("%c", oui); + return EXIT_SUCCESS; +} +/*[004867123,41545574] +[B,O,B,<,O,>] +004867123 BOB +41545574 */ \ No newline at end of file diff --git a/DEV1.1S/TP03/records.c b/DEV1.1S/TP03/records.c new file mode 100644 index 0000000..5d1bc44 --- /dev/null +++ b/DEV1.1S/TP03/records.c @@ -0,0 +1,27 @@ +#include +#include +int main(void){ + FILE* fichier; + fichier = fopen("top10", "r"); + int tab[10]; + char oui[30]; + int i; + int a; + int alt = 4; + for(i=0; i<10; i++){ + fread(&tab[i], sizeof(int), 1,fichier); + fread(&oui[i*3], 1, 3, fichier); + } + for(i=0; i<10;i++){ + printf("%9d ", tab[i]); + printf("%c", oui[i*3]); + printf("%c", oui[i*3+1]); + printf("%c\n", oui[i*3+2]); + } + fclose(fichier); + return EXIT_SUCCESS; +} +/*[004867123,41545574] +[B,O,B,<,O,>] +004867123 BOB +41545574 */ \ No newline at end of file diff --git a/DEV1.1S/TP03/top10 b/DEV1.1S/TP03/top10 new file mode 100644 index 0000000000000000000000000000000000000000..f6c571a816785dc8c14743ba17b4674c55b4c5ea GIT binary patch literal 70 zcmXqZ@nUfDce*U>#bD!ar&6QN5R +#include +#include + +struct mail{ + int valeur; + struct mail* suivant; +}; +typedef struct mail maillon; + +void afficher(maillon* premier) { + maillon* p; + for(p = premier; p != NULL; p = p->suivant) + printf("%d ", p->valeur); +} + +maillon* ajouter_debut(maillon* premier, int nouveau) { + maillon* p = (maillon*) malloc(sizeof(maillon)); + if (p) { + p->suivant = premier; + p->valeur = nouveau; + } + return p; +} +int main(int argc, char const *argv[]){ + maillon* vide= NULL; + srand(time(NULL)); + int i; + int stock; + int maximilien = 111; + for(i=0; i<10; i++){ + stock = 111+random()%889; + vide = ajouter_debut(vide , stock); + if(stock > maximilien){ + maximilien = stock; + } + } + afficher(vide); + printf("\n%d\n", maximilien); + + return 0; +} diff --git a/DEV1.1S/TPLC/exo2.c b/DEV1.1S/TPLC/exo2.c new file mode 100644 index 0000000..ba7b95d --- /dev/null +++ b/DEV1.1S/TPLC/exo2.c @@ -0,0 +1,42 @@ +#include +#include +#include + +struct mail{ + int valeur; + struct mail* suivant; +}; +typedef struct mail maillon; + +void afficher(maillon* premier) { + maillon* p; + for(p = premier; p != NULL; p = p->suivant) + printf("%d ", p->valeur); +} + +maillon* ajouter_debut(maillon* premier, int nouveau) { + maillon* p = (maillon*) malloc(sizeof(maillon)); + if (p) { + p->suivant = premier; + p->valeur = nouveau; + } + return p; +} +int main(int argc, char const *argv[]){ + maillon* vide= NULL; + srand(time(NULL)); + int i; + int stock; + int maximilien = 111; + for(i=0; i<10; i++){ + stock = 111+random()%889; + vide = ajouter_debut(vide , stock); + if(stock > maximilien){ + maximilien = stock; + } + } + afficher(vide); + printf("\n%d\n", maximilien); + + return 0; +} diff --git a/DEV1.1S/TPLC/test.c b/DEV1.1S/TPLC/test.c new file mode 100644 index 0000000..9ad285c --- /dev/null +++ b/DEV1.1S/TPLC/test.c @@ -0,0 +1,52 @@ +#include +#include + +struct mail{ + int valeur; + struct mail* suivant; +}; +typedef struct mail maillon; + +void afficher(maillon* premier) { + maillon* p; + for(p = premier; p != NULL; p = p->suivant) + printf("%d ", p->valeur); +} + +maillon* ajouter_debut(maillon* premier, int nouveau) { + maillon* p = (maillon*) malloc(sizeof(maillon)); + if (p) { + p->suivant = premier; + p->valeur = nouveau; + } + return p; +} + +void delete(int v, maillon* vide){ + maillon* m; + m=vide; + int i; + for (i=0;isuivant; + } + free(m->suivant); + m->suivant=NULL; +} + + +int main(int argc, char const *argv[]){ + maillon* vide= NULL; + maillon* m; + int i; + for(i=1; i<4; i++){ + vide = ajouter_debut(vide , i); + } + afficher(vide); + printf("\n"); + delete(3, vide); + afficher(vide); + printf("\n"); + return 0; +} + +/*Q7d8s6dp&#*/ \ No newline at end of file diff --git a/DEV1.1S/TPPILE/chainee.c b/DEV1.1S/TPPILE/chainee.c new file mode 100644 index 0000000..597c597 --- /dev/null +++ b/DEV1.1S/TPPILE/chainee.c @@ -0,0 +1,44 @@ +#include +#include + +struct maillon_ { + char c; + struct maillon_* prev; +}; + +typedef struct maillon_ maillon; +typedef maillon* pile; + +void push(pile* p, char c) { + maillon* m = calloc(1, sizeof(maillon)); + m->c = c; + m->prev = *p; + + *p = m; +} + +char pop(pile* p) { + char c = (*p)->c; + *p = (*p)->prev; + return c; +} + +int empty(pile p) { + return p == NULL; +} + +char top(pile p) { + return p->c; +} + +void clear(pile* p) { + *p = NULL; +} + +pile create() { + return NULL; +} + +void destroy(pile* p) { + free(p); +} \ No newline at end of file diff --git a/DEV1.1S/TPPILE/chainee_tables.c b/DEV1.1S/TPPILE/chainee_tables.c new file mode 100644 index 0000000..d4fbccd --- /dev/null +++ b/DEV1.1S/TPPILE/chainee_tables.c @@ -0,0 +1,47 @@ +#include +#include + +struct pile_ { + char* tab; + int size; +}; + +typedef struct pile_ pile; + +void push(pile* p, char c) { + (p->tab)[p->size] = c; + p->size++; + p->tab = realloc(p->tab, (p->size)+1); +} + +char pop(pile* p) { + char c = (p->tab)[p->size-1]; + p->size--; + p->tab = realloc(p->tab, (p->size)+1); + return c; +} + +int empty(pile p) { + return p.size == 0; +} + +char top(pile p) { + return (p.tab)[(p.size) - 1]; +} + +void clear(pile* p) { + free(p->tab); + p->tab = calloc(1, sizeof(int)); + p->size = 0; +} + +pile create() { + pile* p = (calloc(1, sizeof(pile))); + p->tab = calloc(1, sizeof(char)); + p->size = 0; + return *p; +} + +pile destroy(pile* p) { + free(p); +} \ No newline at end of file diff --git a/DEV1.1S/TPPILE/file.c b/DEV1.1S/TPPILE/file.c new file mode 100644 index 0000000..bb4f23a --- /dev/null +++ b/DEV1.1S/TPPILE/file.c @@ -0,0 +1,34 @@ +#include +#include + +struct maillon_ { + char c; + struct maillon_* next; +}; + +typedef struct maillon_ maillon; +typedef maillon* file; + +void push(file* f, char c) { + maillon* m = calloc(1, sizeof(maillon)); + m->c = c; + + if (*f == NULL) { + *f = m; + } else { + file* start = f; + file ff = *f; + while (ff->next != NULL) ff = ff->next; + ff->next = m; + f = start; + } +} + +char pop(file* f) { + char c = (*f)->c; + *f = (*f)->next; +} + +int empty(file f) { + return f == NULL; +} \ No newline at end of file diff --git a/DEV1.1S/TPREC/exo2.c b/DEV1.1S/TPREC/exo2.c new file mode 100644 index 0000000..e69de29 diff --git a/DEV1.1S/TPREC/fibonacci.c b/DEV1.1S/TPREC/fibonacci.c new file mode 100644 index 0000000..92a5c43 --- /dev/null +++ b/DEV1.1S/TPREC/fibonacci.c @@ -0,0 +1,13 @@ +#include +#include + +int fib(int n) { + if (n > 1) return n + fib(n-1); + else if (n == 1) return 1; + else return 0; +} + +int main(void) { + fib(15); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1S/TPREC/tableau.c b/DEV1.1S/TPREC/tableau.c new file mode 100644 index 0000000..ffe0bb4 --- /dev/null +++ b/DEV1.1S/TPREC/tableau.c @@ -0,0 +1,17 @@ +#include +#include + +void printTable(double* t, int n) { + if (n > 0) { + printf("%.5lf", *t); + if (n > 1) printf(", "); + printTable(t+1, n-1); + } else puts(""); +} + +int main(void) { + double t[5] = {1.72, 5.28, 9.025, 36.14, 3.14159}; + + printTable(t, 5); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV2.1/TP01/Bonjour.class b/DEV2.1/TP01/Bonjour.class new file mode 100644 index 0000000000000000000000000000000000000000..12e2a1f630172beb3b70d1dd6f1e8ce6cf3bb8f4 GIT binary patch literal 955 zcmaJYuW6g>|H9!$qV2Pm~ImHIiLEq+vN1+5lsqG{9w)5MR>P$tcg`5-u$nD`%D z*MHzr7t=%&7cTujZjJXslcvSYTbz5|JNM1I=g$58_xn!(YuHp#z*2%ZuaC;+!NKR` zgI4CP@#oj4G|r(cv8*D6C5H1UT;O<-;S$4ThARvPLxrKL;wr95tVpa1B%8Kp2loZy zMrBt(Y584CAhTn8*0Z78u?8>AjzcGkYucW`tnp^2XTCRUj_K{!+QGo~_8WXrZTrK) zp0#arvbN=WJ=(8ws)ktcY4-daN?-_;ay<4J>v4=`s$v&*;u1{Ra61saJL?1;_D5Hn*nO;ehUK_G?6hdWMG&O zTXlRVTqo%HnIl4Eqjn+*@g2vPdrhw-gF{hr8Hsqp@d{X5?()|x?CZaRwGxfM9BD;E{hMh7edBQ{1cMu^TW@HUXOF^&lXlQyO> z&GBpV zE>D-v|2)Wkm)Avo3;$k2i>qku=$L& zK$X~qZuV8G$5fr|!Y#Cveuv1czVv|Ts=hWnbcI2M#u)vHUTSpx@uEs26F7rbE7y%Eog5@61^hBO%p9{@)Ku%b@c!M literal 0 HcmV?d00001 diff --git a/DEV2.1/TP01/Grille.java b/DEV2.1/TP01/Grille.java new file mode 100644 index 0000000..60c1b9c --- /dev/null +++ b/DEV2.1/TP01/Grille.java @@ -0,0 +1,10 @@ +public class Grille{ + public static void main(String[] args) { + System.out.println("+-+-+"); + int a = Integer.parseInt(args[0]); + for (int i=0; i< a; i++){ + System.out.println("| | |"); + System.out.println("+-+-+"); + } + } +} \ No newline at end of file diff --git a/DEV2.1/TP01/Somme.class b/DEV2.1/TP01/Somme.class new file mode 100644 index 0000000000000000000000000000000000000000..adb35d4c392fa9e98980af73a554d30a511b9ec4 GIT binary patch literal 576 zcmZuu%SyvQ6g{_@WNM9X8R{*P+%fUfk4*eMDz#zOFhA=EKA~8yEN;#eCYll@GAF67DDTgqch1zMDmGM9FIJK`i0T`L*i}hX z?R;0YQoO_%Ay;X(_M|_2tW9sSv=t9CHzRO z!VOkWb^ewKvSmOG_D1;S`6EojX1mSGfWIQkX9s5mj>OSkcmmz?g+1ZZNs9*33778% zdd*bHaoH*@>@L1;T5G}+gi&Mby9cm|q5}un6ech!Fy+8PHi>D2GbX%u zFpHeP2Z1?4;*<7uxI?hK{64|{5;PQHxT1aaz1Oa(?w+i*xMH`Z_6ZZ-VWlZgWvM0o zqf#~OYX4~42-DS2){no*PQ(|OCpguh*R89s+UQg2EGTansf!`F0t+q{u|$~szuj(6 zw;HNTNbUxHlUvNYSjLKrRjdhkF7hbwKBgaGQS7Fg9SrSH$Z1NvPWFIOs7w z`|L*trJrmjWJ^l6xA`!#(@}nduDLnpqGRT_ z_{iBo6Zf%z6hEx_Vjy!wj%ohOF%o0Ea0|NTgz%1IA}aFbF^mz;4OR2|#~I6oO7Z@) zwUe8@gjdX!x9l6le!)7pg`J7_k(jnQ^db64URZSX^vCp#MSU}{Ikzy%SY-UjlSa9c SM(hznAVc)PZ^Sku$@pK1^^?*7 literal 0 HcmV?d00001 diff --git a/DEV2.1/TP01/exo2.java b/DEV2.1/TP01/exo2.java new file mode 100644 index 0000000..f6b65a4 --- /dev/null +++ b/DEV2.1/TP01/exo2.java @@ -0,0 +1,7 @@ +public class exo2{ + public static void main(String[] args) { + for(String i : args){ + System.out.println("Bonjour " + i); + } + } +} \ No newline at end of file diff --git a/DEV2.1/TP01/tri.class b/DEV2.1/TP01/tri.class new file mode 100644 index 0000000000000000000000000000000000000000..c7477e738422d66ef7350324443e8a8c37c150a2 GIT binary patch literal 857 zcmaJ<%Wl(95IxtirY4T#{epLpdp5H8qVW_hKn$w z$l#KS%Ni7sR*;QgLHH}eT-9(5*HtX4xWN#9XgjvQ$`CSh+YIs(x5F7`>$bx;f_{s8 zTUM(_8M$xS4nxXp)_1H|R=H<6-EzbCY^S>-fU$;ewO_7VgGs##lR;~^f!F3wZGn$a zX-Ob;oWZP$oQ^ySDvCOmP*PFWaTB)~(too*4(wisdpeeJn}KCTP|~X&4_`J(K8fRd6LrzDAq z^q=~O?@q6RAz_{*CdT=R27eAjiwwkg|BzrC3()Du5|0EXu8r&*oigMZc_n`U_Lc(D zm~42Gln_N6^AwBHH;^e0JkO6mYW2_~BR}3pykO*w(aaAE3NAKsc$4pvEI3L`Tp@nAwvF_gS=-Cao8#DX5h~Z;TqI$Qy_t lOZf^kY>?lgFA1tjL;em`MUs6(;s`S$Vqa09iBl88^iTL-zU2S_ literal 0 HcmV?d00001 diff --git a/DEV2.1/TP01/tri.java b/DEV2.1/TP01/tri.java new file mode 100644 index 0000000..2d5713f --- /dev/null +++ b/DEV2.1/TP01/tri.java @@ -0,0 +1,14 @@ +import java.util.Arrays; +public class tri{ + public static void main(String[] args) { + int[] tab = new int[args.length]; + for(int i=0; ikQFV(=xp^hHxsq z!ypyx8fWM)nik*kn-%UnH7X6tNKM1E7)DYrihIU^k!=`OJzMr1)2io0VXSQXPL*$% zLagR(-?J@uK}c1MBEg`E?>AYuMHSh{8;;TBDsJGWidzD1V})U;OOy9K+Js?l`@lbF z@y?qpS%=)?1hh_W*IT^lR|t|N*EL*mR_@=kibjPuRIFk}#T{`>Jm|n^dD*<})VNbL z4(Yz+MS)u$cT}w5E*WC`CPRe!@?KNivKh=^1xD75A{tAfI;2Fc54USW~L( z@hS;rmwRRNh)jv3HaCS+y_6~1Rl_qybECAn&tDmS!z(mwmzVarb4p36Kp#*2-|-Qu zd}KT3k!^WKW4&S4ttQ={VVH;=?s#UkD;+j!HHP%*Zle2w-Q2e=s>z)>p>y%hKNTC9 zuGtxY)bsQXCNM&?D4r1L@<z21yA$xD-f8%9aqO`2^Z0 z2<;vtT+|2IuR)e+L(;?HHX?eojpzyFT}?Sg&yx)0dIhL@M(b;%KcEJP+L{-X09BvY z2G3F}QbH1BfU2I5G_8w{Bq9MVkm!gu)I~=V(SR06bW|HAT9?|0|LturXk3Ou-D!xC z8NJlwIn1ID8T4Zj12ozi@)*KH45NrR%4FV4Qr5^gQSXp1Z>j1X#_%5F_&^4K#3Vjp U3ZF5JFPOnMq{+oGax8@LKL_I9lmGw# literal 0 HcmV?d00001 diff --git a/DEV2.1/TP02/Boutons.java b/DEV2.1/TP02/Boutons.java new file mode 100644 index 0000000..12d4f33 --- /dev/null +++ b/DEV2.1/TP02/Boutons.java @@ -0,0 +1,42 @@ +import javax.swing.*; +import java.awt.*; + +public class Boutons { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // un composant pour afficher du texte + JButton bouton1 = new JButton("Uvuvwevwevwe Onyetenyevwe Ugwemubwem Ossas"); + bouton1.setHorizontalAlignment(JLabel.CENTER); + bouton1.setVerticalAlignment(JLabel.CENTER); + fenetre.add(bouton1, BorderLayout.CENTER); + + JButton bouton2 = new JButton("oui"); + bouton2.setHorizontalAlignment(JLabel.CENTER); + bouton2.setVerticalAlignment(JLabel.CENTER); + fenetre.add(bouton2, BorderLayout.SOUTH); + + JButton bouton3 = new JButton("oui"); + bouton3.setHorizontalAlignment(JLabel.CENTER); + bouton3.setVerticalAlignment(JLabel.CENTER); + fenetre.add(bouton3, BorderLayout.NORTH); + + JButton bouton4 = new JButton("oui"); + bouton4.setHorizontalAlignment(JLabel.CENTER); + bouton4.setVerticalAlignment(JLabel.CENTER); + fenetre.add(bouton4, BorderLayout.EAST); + + JButton bouton5 = new JButton("oui"); + bouton5.setHorizontalAlignment(JLabel.CENTER); + bouton5.setVerticalAlignment(JLabel.CENTER); + fenetre.add(bouton5, BorderLayout.WEST); + + fenetre.setVisible(true); + + + } +} \ No newline at end of file diff --git a/DEV2.1/TP02/Choix.class b/DEV2.1/TP02/Choix.class new file mode 100644 index 0000000000000000000000000000000000000000..660793d2177075f1aa1793f51f18ce2570ec9c13 GIT binary patch literal 958 zcmZuwTTc^F5dKcP?Jmm-bh*|WpaLyzsS4h>Db#?NS`tf0z^84yl!NV_db*X%gD?7r zd}$L&`~m(Be}d1(Ia`RBxSPy5`^`5q-^{c>et-K8U;%3;Mlqpd(nJUo%G^=rt}^#@ zOc|Iqp<_mwgpQ;L@NE^r)m@|;oao>ckqHR1--iJEobu2JMm$}FNRfcdPxyzvC zM8#$3&vVZ$wCW{S?l`3yAzIzx9>YlDUH-`V=wxe-SIriE$-U~53N(wNCClyxS7bAH zDEP^oB3c+joWWN2lWg;t_}SMR(y6-^9^tWtC(1mW?b4B3rmA|=^^5$B%0v=d zTWTo1gycop@wsYZjJ{sF2TrTz=W3$qZZ}+c;nETTe>m~~;f_$`DHEWDx^Po5vB%_6ZMAh$hmYSRaarKr|~ZLausW(rZ1hc-|e=$Nh-F>o4mXB#C~!Y zlNh1jpn5`}J`g8+oxX0-$>@yCcEG;Uh2aL-Xct5eZUz)Z{fRK)z?XA`_BsgXQ!(}{ z#?ozQsc^WBNGjS!^c?!0ZFJD{CQX=`O50W&*8;SU&_X6aGj{(aIzZ^67S{qiuGz7` zVN->{#Yj9t>4)NxOkm?09Vs%yf0Y(6NSX|K)jy+`TC+%TA7;>xG-8-1{|bh%P6OB? i?+&%TPd%21^&aE+fC(Jacs^kYpD|5+-==&ajQ;@x^UqTN literal 0 HcmV?d00001 diff --git a/DEV2.1/TP02/Choix.java b/DEV2.1/TP02/Choix.java new file mode 100644 index 0000000..9c40882 --- /dev/null +++ b/DEV2.1/TP02/Choix.java @@ -0,0 +1,36 @@ +import javax.sql.rowset.serial.SerialArray; +import javax.swing.*; +import java.awt.*; + +public class Choix { + public static void main(String[] args) { + // un objet pour servir de fenetre + JFrame fenetre = new JFrame(); + // on configure la fenetre + fenetre.setSize(500, 300); + fenetre.setLocation(0, 0); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JRadioButton Gryffondor = new JRadioButton("Gryffondor"); + Gryffondor.setHorizontalAlignment(JRadioButton.CENTER); + fenetre.add(Gryffondor, BorderLayout.NORTH); + + JRadioButton Serdaigle = new JRadioButton("Serdaigle"); + Serdaigle.setHorizontalAlignment(JRadioButton.CENTER); + fenetre.add(Serdaigle, BorderLayout.CENTER); + + JRadioButton Serpentard = new JRadioButton("Serpentard"); + Serpentard.setHorizontalAlignment(JRadioButton.CENTER); + fenetre.add(Serpentard, BorderLayout.SOUTH); + + ButtonGroup Groupe = new ButtonGroup(); + + Groupe.add(Gryffondor); + Groupe.add(Serdaigle); + Groupe.add(Serpentard); + + + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV2.1/TP02/Saisie.class b/DEV2.1/TP02/Saisie.class new file mode 100644 index 0000000000000000000000000000000000000000..415ffb93b853d07bd8d0dae544d3b6b8632ac746 GIT binary patch literal 1013 zcmZuwTT|0e5dKcnHYF{W23qi5@Ip!p^@5^;AQU=+6`U!9q7P1Jk2RPkOqvKX;~Ovf zZ+vNI?2JFaSKs_G>Yk)lnK6^ubN1VBzwGWg`S$b6R{*mpDL8`(8J87=Fd@tpVXg{u zO~zylngSVF8B+=r(hP$%x21XfV&l6qx}l9nB=)7XmKaycolVvW3@Uxp!H)1S@O z-afCAoZRGY#W<#^M6~sFF{(HrWxJ}ohD{S4BX5j6Ph%CE5$>4?@GVe(E5!+lExmC8d*O=y?m_oFugn$wga;b|CMnu{QdiYNg&d#2hIWxOIetr86;2|E{C}GpWWg97MYPh0dOT$$Q*Rt5Q zVWFzwx`rDTZf0>ypWoK7W5KmhW5_&}kxcd&47b*0Fx#px7z)0O#M|+(C*pU!7m~*u zav3pH+zxJyeC42+%nmARcC5BxQnKPdz!yKm%>kz)(aK)MeOr0YMfA0 zZ4o6Rc5ojL92(an25Xsxp?I$Uuy-s1;#(t;bmWATr`>}C-ACXA%bizuX4z_Ze!- zY`U|y8lI?#Vs`(iun@i&yiO!Xa&b%U`&t)O6zO^BF9jMZRteW=w?!+XHC>;9eI!_TaA@`