This commit is contained in:
moogin 2024-10-22 15:14:54 +02:00
parent 094a8ed4b1
commit 3ada35614f
16 changed files with 170 additions and 4 deletions

12
DEV1.1/CM1/exo1.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf(" .-\"-. \n");
printf(" _/.-.-.\\_ \n");
printf("( ( 0 0 ) ) \n");
printf(" |/ \" \\| \n");
printf(" \\ .-. / \n");
printf(" /`\"\"\"`\\ \n");
printf(" / \\ \n");
}

15
DEV1.1/CM1/exo2.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
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;
}

30
DEV1.1/CM1/exo3.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
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;
}

8
DEV1.1/CM1/exo4.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
double proba=0;
proba = (15/36)*100;
printf("%.2f\n", proba);
}

77
DEV1.1/CM1/exo5.c Normal file
View File

@ -0,0 +1,77 @@
#include <stdio.h>
#include <stdlib.h>
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;
}
}
}
}
}

Binary file not shown.

7
DEV1.1/chaine.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("https://iut-fbleau.fr/sitebp/dev11bis/files/maquette.svg");
}

View File

@ -13,4 +13,6 @@ int main(void) {
printf("Le double vaut %d\n", somme(*p, *p)); printf("Le double vaut %d\n", somme(*p, *p));
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
a

BIN
DEV1.1/moogin_CM1.tar.gz Normal file

Binary file not shown.

View File

@ -74,13 +74,14 @@ int main(void) {
for (i=4; i<5;i++){ for (i=4; i<5;i++){
t3[4][i] = 0; t3[4][i] = 0;
printf("%2d ", t3[4][i]); printf("%2d ", t3[4][i]);
} }
printf("\n");
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
int main(void) { /*int main(void) {
int i,t1[2][5], t2[3][5], t3[5][5]; int i,t1[2][5], t2[3][5], t3[5][5];
for (i=0; i<5;i++){ for (i=0; i<5;i++){
@ -150,4 +151,4 @@ printf("\n");
printf("%2d\n ", t3[4][i]); printf("%2d\n ", t3[4][i]);
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }*/

14
DEV1.1/types.txt Normal file
View File

@ -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