"depot M112"
This commit is contained in:
43
TD1/TD1.cbp
Executable file
43
TD1/TD1.cbp
Executable file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="TD1" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/TD1" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/TD1" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
5
TD1/TD1.depend
Executable file
5
TD1/TD1.depend
Executable file
@ -0,0 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1514144174 source:f:\cours\dut\m112\projets code block\td1\main.c
|
||||
<stdio.h>
|
||||
<stdlib.h>
|
||||
|
10
TD1/TD1.layout
Executable file
10
TD1/TD1.layout
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.c" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="105" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
43
TD1/exo2/exo2.cbp
Executable file
43
TD1/exo2/exo2.cbp
Executable file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="exo2" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/exo2" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/exo2" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
5
TD1/exo2/exo2.depend
Executable file
5
TD1/exo2/exo2.depend
Executable file
@ -0,0 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1537264359 source:f:\cours\dut\m112\projets code block\exo2\main.c
|
||||
<stdio.h>
|
||||
<stdlib.h>
|
||||
|
10
TD1/exo2/exo2.layout
Executable file
10
TD1/exo2/exo2.layout
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="721" topLine="9" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
36
TD1/exo2/main.c
Executable file
36
TD1/exo2/main.c
Executable file
@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
/*Exercice 2 - Partie 1*/
|
||||
double tab[4] = {10, 20, -15, 30};
|
||||
double total = 0;
|
||||
|
||||
/*Exercice 2 - Partie 2*/
|
||||
double tab2[10];
|
||||
double total2 = 0;
|
||||
|
||||
/*Exercice 2 - Partie 1*/
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
total = total + tab[i];
|
||||
}
|
||||
printf("Voici la reponse de l'exercice 1 :\n");
|
||||
printf("%lf\n\n\n", total);
|
||||
|
||||
/*Exercice 2 - Partie 2*/
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
printf("Entrez la valeur %d du tableau\n", i+1);
|
||||
scanf("%lf", &tab2[i]);
|
||||
total2 = total2 + tab2[i];
|
||||
}
|
||||
printf("Voici la reponse de l'exercice 2 :\n");
|
||||
printf("%lf\n\n\n", total2);
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
43
TD1/exo3/exo3.cbp
Executable file
43
TD1/exo3/exo3.cbp
Executable file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="exo3" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/exo3" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/exo3" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
10
TD1/exo3/exo3.layout
Executable file
10
TD1/exo3/exo3.layout
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="410" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
26
TD1/exo3/main.c
Executable file
26
TD1/exo3/main.c
Executable file
@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char tab[10];
|
||||
char voy;
|
||||
int count = 0;
|
||||
int total = 0;
|
||||
|
||||
for(int n = 0; n < 10; n++)
|
||||
{
|
||||
printf("Entrez le caractere numero %d\n", n+1);
|
||||
fflush(stdin);
|
||||
scanf("%char", &tab[n]);
|
||||
if(tab[n] == 'a' || tab[n] == 'e' || tab[n] == 'i' || tab[n] == 'o' || tab[n] == 'u' || tab[n] == 'y')
|
||||
{
|
||||
count++;
|
||||
}
|
||||
total++;
|
||||
}
|
||||
|
||||
printf("Il y a %d caracteres qui ont ete saisis au clavier.\n", total);
|
||||
printf("Il y a %d voyelles qui ont ete saisis au clavier.\n", count);
|
||||
return 0;
|
||||
}
|
44
TD1/exo4/exo4.cbp
Executable file
44
TD1/exo4/exo4.cbp
Executable file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="exo4" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/exo4" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/exo4" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
10
TD1/exo4/exo4.layout
Executable file
10
TD1/exo4/exo4.layout
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="168" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
52
TD1/exo4/main.c
Executable file
52
TD1/exo4/main.c
Executable file
@ -0,0 +1,52 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char tab[10];
|
||||
char tabVoy[10];
|
||||
char tabCons[10];
|
||||
int Nv = 0;
|
||||
int Nc = 0;
|
||||
int count = 0;
|
||||
|
||||
for(int n = 0; n < 10; n++)
|
||||
{
|
||||
printf("Entrez le caractere numero %d\n", n+1);
|
||||
fflush(stdin);
|
||||
scanf("%char", &tab[n]);
|
||||
if(tab[n] == 'a' || tab[n] == 'e' || tab[n] == 'i' || tab[n] == 'o' || tab[n] == 'u' || tab[n] == 'y')
|
||||
{
|
||||
tabVoy[Nv] = tab[n];
|
||||
Nv++;
|
||||
}
|
||||
else
|
||||
{
|
||||
tabCons[Nc] = tab[n];
|
||||
Nc++;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Voici le tablau des 10 carateres :\n");
|
||||
|
||||
for(count = 0; count < 10; count++)
|
||||
{
|
||||
printf("%c ", tab[count]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
printf("Voici le tablau des 10 carateres :\n");
|
||||
for(count = 0; count < 10; count++)
|
||||
{
|
||||
printf("%c ", tabVoy[count]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
printf("Voici le tablau des %d consonnes :\n", Nc);
|
||||
for(count = 0; count < 10; count++)
|
||||
{
|
||||
printf("%c ", tabCons[count]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
44
TD1/exo6/exo6.cbp
Executable file
44
TD1/exo6/exo6.cbp
Executable file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="exo5" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/exo5" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/exo5" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="main.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<envvars />
|
||||
<debugger />
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
10
TD1/exo6/exo6.layout
Executable file
10
TD1/exo6/exo6.layout
Executable file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="126" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
10
TD1/exo6/main.c
Executable file
10
TD1/exo6/main.c
Executable file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
return 0;
|
||||
}
|
8
TD1/main.c
Executable file
8
TD1/main.c
Executable file
@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user