"depot M112"
This commit is contained in:
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;
|
||||
}
|
Reference in New Issue
Block a user