diff --git a/DEV1.1/CM1/exo1.c b/DEV1.1/CM1/exo1.c new file mode 100644 index 0000000..513abda --- /dev/null +++ b/DEV1.1/CM1/exo1.c @@ -0,0 +1,12 @@ +#include +#include + +int main(void){ + printf(" .-\"-. \n"); + printf(" _/.-.-.\\_ \n"); + printf("( ( 0 0 ) ) \n"); + printf(" |/ \" \\| \n"); + printf(" \\ .-. / \n"); + printf(" /`\"\"\"`\\ \n"); + printf(" / \\ \n"); +} \ No newline at end of file diff --git a/DEV1.1/CM1/exo2.c b/DEV1.1/CM1/exo2.c new file mode 100644 index 0000000..f05e252 --- /dev/null +++ b/DEV1.1/CM1/exo2.c @@ -0,0 +1,15 @@ +#include +#include + +int main(void) { + float a = 1; + unsigned int b = 11; + char c = 111; + short int d = 1111; + + printf("%e\n", a); + printf("%7o\n", b); + printf("%c\n", c); + printf("%2hd\n", d); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/CM1/exo3.c b/DEV1.1/CM1/exo3.c new file mode 100644 index 0000000..c47efe7 --- /dev/null +++ b/DEV1.1/CM1/exo3.c @@ -0,0 +1,30 @@ +#include +#include + +int main(void){ + char charactere; + char tab[6]={'a','e','i','o','y'}; + printf("entrez un charactère : "); + scanf("%c", &charactere); + + if(charactere == 'a'){ + printf("voyelle"); + }else if(charactere == 'e'){ + printf("voyelle"); + }else if(charactere == 'i'){ + printf("voyelle"); + }else if(charactere == 'o'){ + printf("voyelle"); + }else if(charactere == 'u'){ + printf("voyelle"); + }else if(charactere == 'y'){ + printf("voyelle"); + }else{ + printf("minuscule"); + } + + printf("\n"); + + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/CM1/exo4.c b/DEV1.1/CM1/exo4.c new file mode 100644 index 0000000..59a9fad --- /dev/null +++ b/DEV1.1/CM1/exo4.c @@ -0,0 +1,8 @@ +#include +#include +#include +int main(void) { + double proba=0; + proba = (15/36)*100; + printf("%.2f\n", proba); +} \ No newline at end of file diff --git a/DEV1.1/CM1/exo5.c b/DEV1.1/CM1/exo5.c new file mode 100644 index 0000000..1cec1cb --- /dev/null +++ b/DEV1.1/CM1/exo5.c @@ -0,0 +1,77 @@ +#include +#include + +int main(void) { + int tab[10][10]{{'x','x','x','x','x','x','x','x','x','x' }, + {'x','x','x','x','x','x','x','x','x','x'}, + {'x','x','x','x','x','x','x','x','x','x'}, + {' ',' ',' ',' ',' ',' ',' ','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'}, + {' ','x','x','x','x','x','x','x','x','x'} }; + int x =7; + int y =4; + char direction; + int ysortie; + int xsortie; + int i; + + + + for (i = 0; i<= i; i++){ + printf("vers ou ? "); + scanf("%c", direction); + if(y == ysortie && x=xsortie){ + return EXIT_SUCCESS; + }else if(direction == 'N'){ + + y+=1; + if (tab[y][x]=' '){ + printf("ok"); + }else{ + printf("bloquer"); + y-=1; + } + + }else if(direction == 'S'){ + + y-=1; + if (tab[y][x]=' '){ + printf("ok"); + }else{ + printf("bloquer"); + y+=1; + } + }else if(direction == 'E'){ + + x+=1; + if (tab[y][x]=' '){ + printf("ok"); + }else{ + printf("bloquer"); + x-=1; + } + + }else if(direction == 'O'){ + + x-=1; + if (tab[y][x]=' '){ + printf("ok"); + } + }else{ + printf("bloquer"); + x+=1; + } + + } + } +} + + + + + +} \ No newline at end of file diff --git a/DEV1.1/CM1/moogin_CM1.tar.gz b/DEV1.1/CM1/moogin_CM1.tar.gz new file mode 100644 index 0000000..872c015 Binary files /dev/null and b/DEV1.1/CM1/moogin_CM1.tar.gz differ diff --git a/DEV1.1/boucles.c b/DEV1.1/boucles/boucles.c similarity index 100% rename from DEV1.1/boucles.c rename to DEV1.1/boucles/boucles.c diff --git a/DEV1.1/boucle_encore.c b/DEV1.1/boucles/boucles_encore.c similarity index 100% rename from DEV1.1/boucle_encore.c rename to DEV1.1/boucles/boucles_encore.c diff --git a/DEV1.1/boucles_suite.c b/DEV1.1/boucles/boucles_suite.c similarity index 100% rename from DEV1.1/boucles_suite.c rename to DEV1.1/boucles/boucles_suite.c diff --git a/DEV1.1/chaine.c b/DEV1.1/chaine.c new file mode 100644 index 0000000..b335729 --- /dev/null +++ b/DEV1.1/chaine.c @@ -0,0 +1,7 @@ +#include +#include + +int main(void){ + printf("https://iut-fbleau.fr/sitebp/dev11bis/files/maquette.svg"); + +} diff --git a/DEV1.1/debogueur.c b/DEV1.1/debogueur.c index 8c13fce..d2d02b9 100755 --- a/DEV1.1/debogueur.c +++ b/DEV1.1/debogueur.c @@ -13,4 +13,6 @@ int main(void) { printf("Le double vaut %d\n", somme(*p, *p)); return EXIT_SUCCESS; -} \ No newline at end of file +} +a + diff --git a/DEV1.1/moogin_CM1.tar.gz b/DEV1.1/moogin_CM1.tar.gz new file mode 100644 index 0000000..81da531 Binary files /dev/null and b/DEV1.1/moogin_CM1.tar.gz differ diff --git a/DEV1.1/tableau_multidimensionel.c b/DEV1.1/tableaux/tableau_multidimensionel.c similarity index 100% rename from DEV1.1/tableau_multidimensionel.c rename to DEV1.1/tableaux/tableau_multidimensionel.c diff --git a/DEV1.1/tableaux.c b/DEV1.1/tableaux/tableaux.c similarity index 100% rename from DEV1.1/tableaux.c rename to DEV1.1/tableaux/tableaux.c diff --git a/DEV1.1/tableaux_multi.c b/DEV1.1/tableaux/tableaux_multi.c similarity index 98% rename from DEV1.1/tableaux_multi.c rename to DEV1.1/tableaux/tableaux_multi.c index aaeb490..535c169 100644 --- a/DEV1.1/tableaux_multi.c +++ b/DEV1.1/tableaux/tableaux_multi.c @@ -74,13 +74,14 @@ int main(void) { for (i=4; i<5;i++){ t3[4][i] = 0; printf("%2d ", t3[4][i]); - } + } + printf("\n"); return EXIT_SUCCESS; } -int main(void) { +/*int main(void) { int i,t1[2][5], t2[3][5], t3[5][5]; for (i=0; i<5;i++){ @@ -150,4 +151,4 @@ printf("\n"); printf("%2d\n ", t3[4][i]); } return EXIT_SUCCESS; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/DEV1.1/types.txt b/DEV1.1/types.txt new file mode 100644 index 0000000..f730f2c --- /dev/null +++ b/DEV1.1/types.txt @@ -0,0 +1,14 @@ +signed char 8 %c, %hhd, %hhi 'Y' +unsigned char 8 %c, %hhu, %hho, %hhx, %hhX 'z' +short int 16 %hd, %hi +unsigned short int 16 %hu, %ho, %hx, %hX +int 32 %d, %i -24 +unsigned int 32 %u, %o, %x, %X 97U +long int 64 %ld, %li -148L +unsigned long int 64 %lu, %lo, %lx, %lX 4UL + +Et voici tous les types réels prédéfinis en C : +Type Nombre usuel de bits Formats Exemple +float 32 %f, %e, %E, %g, %a 1.5f +double 64 %lf, %le, %lE, %lg, %la 87.2 +long double 128 %Lf, %Le, %LE, %Lg, %La 4.61L \ No newline at end of file