commit
This commit is contained in:
@ -19,7 +19,10 @@
|
|||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Source5.cpp" />
|
<ClCompile Include="Source8.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="Template.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<VCProjectVersion>17.0</VCProjectVersion>
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
@ -15,8 +15,13 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Source5.cpp">
|
<ClCompile Include="Source8.cpp">
|
||||||
<Filter>Fichiers sources</Filter>
|
<Filter>Fichiers sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="Template.txt">
|
||||||
|
<Filter>Fichiers de ressources</Filter>
|
||||||
|
</Text>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -13,10 +13,10 @@ int main(void) {
|
|||||||
system("cls");
|
system("cls");
|
||||||
printf_s("\t\t\tAffichage de la table ASCII\n");
|
printf_s("\t\t\tAffichage de la table ASCII\n");
|
||||||
for (int i = 15; i < 255; i++) {
|
for (int i = 15; i < 255; i++) {
|
||||||
|
printf_s("\t%c : %3i\t", char(i), i);
|
||||||
if (i % 6 == 0) {
|
if (i % 6 == 0) {
|
||||||
printf_s("\n");
|
printf_s("\n");
|
||||||
}
|
}
|
||||||
printf_s("\t%c : %c%i\t", char(i), i < 100 ? char(32) : char(0), i);
|
|
||||||
}
|
}
|
||||||
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||||
} while (_getch() != 27);
|
} while (_getch() != 27);
|
||||||
|
44
CPP/Source6.cpp
Normal file
44
CPP/Source6.cpp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Programme d'affichage d'une moyenne de notes
|
||||||
|
* Par Florian Goussot
|
||||||
|
* BTS CIEL 2e ann<6E>e
|
||||||
|
* Fait le 05/11/2024 <20> Nancy
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
do {
|
||||||
|
system("cls");
|
||||||
|
printf_s("\t\t\tAffichage d'une moyenne de notes\n");
|
||||||
|
printf_s("Donnez le nombre de notes : ");
|
||||||
|
double notes = 0, max = 0, min = 20;
|
||||||
|
int total_notes = 0;
|
||||||
|
scanf_s("%i", &total_notes);
|
||||||
|
for (int i = 1; i <= total_notes; i++) {
|
||||||
|
printf_s("Entrez une note :");
|
||||||
|
float note = 0;
|
||||||
|
scanf_s("%f", ¬e);
|
||||||
|
if (note >= 0 && note <= 20) {
|
||||||
|
if (note > max) {
|
||||||
|
max = note;
|
||||||
|
}
|
||||||
|
if (note < min) {
|
||||||
|
min = note;
|
||||||
|
}
|
||||||
|
notes += note;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
i--;
|
||||||
|
printf_s("Veuillez entrer une note comprise entre 0 et 20 !\n\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notes /= total_notes;
|
||||||
|
printf_s("La moyenne est de %.2f\n", notes);
|
||||||
|
printf_s("La note la plus basse est de %.2f\n", min);
|
||||||
|
printf_s("La note la plus <20>lev<65>e est de %.2f\n", max);
|
||||||
|
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||||
|
} while (_getch() != 27);
|
||||||
|
return 0;
|
||||||
|
}
|
42
CPP/Source7.cpp
Normal file
42
CPP/Source7.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Programme d'affichage d'une moyenne de notes
|
||||||
|
* Par Florian Goussot
|
||||||
|
* BTS CIEL 2e ann<6E>e
|
||||||
|
* Fait le 05/11/2024 <20> Nancy
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
do {
|
||||||
|
system("cls");
|
||||||
|
printf_s("\t\t\tAffichage d'une moyenne de notes\n");
|
||||||
|
printf_s("Donnez le nombre de notes : ");
|
||||||
|
float notes[10];
|
||||||
|
double max = 0, min = 20, moy = 0;
|
||||||
|
int total_notes = 0;
|
||||||
|
scanf_s("%i", &total_notes);
|
||||||
|
for (int i = 0; i <= total_notes - 1; i++) {
|
||||||
|
printf_s("Entrez une note :");
|
||||||
|
scanf_s("%f", ¬es[i]);
|
||||||
|
if (notes[i] < min) {
|
||||||
|
min = notes[i];
|
||||||
|
}
|
||||||
|
if (notes[i] > max) {
|
||||||
|
max = notes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf_s("\nR<EFBFBD>capitulatif des notes : ");
|
||||||
|
for (int j = 0; j <= total_notes - 1; j++) {
|
||||||
|
printf_s("%.2f\t", notes[j]);
|
||||||
|
moy += notes[j];
|
||||||
|
}
|
||||||
|
moy /= total_notes;
|
||||||
|
printf_s("\nLa moyenne est de %.2f\n", moy);
|
||||||
|
printf_s("La note la plus basse est de %.2f\n", min);
|
||||||
|
printf_s("La note la plus <20>lev<65>e est de %.2f\n", max);
|
||||||
|
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||||
|
} while (_getch() != 27);
|
||||||
|
return 0;
|
||||||
|
}
|
33
CPP/Source8.cpp
Normal file
33
CPP/Source8.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Programme de calcul des nombres premiers
|
||||||
|
* Par Florian Goussot
|
||||||
|
* BTS CIEL 2e ann<6E>e
|
||||||
|
* Fait le 05/11/2024 <20> Nancy
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
do {
|
||||||
|
system("cls");
|
||||||
|
printf_s("\t\t\tProgramme de calcul des nombres premiers\n");
|
||||||
|
printf_s("Donnez le nombre limite (>3) : ");
|
||||||
|
int nombres_premiers[100];
|
||||||
|
int limite = 3;
|
||||||
|
scanf_s("%d", &limite);
|
||||||
|
for (int i = 0; i <= limite; i++) {
|
||||||
|
int nb_diviseurs = 0;
|
||||||
|
for (int j = 2; j <= i; j++) {
|
||||||
|
if (i % j == 1) {
|
||||||
|
nb_diviseurs++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nb_diviseurs == 1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||||
|
} while (_getch() != 27);
|
||||||
|
return 0;
|
||||||
|
}
|
18
CPP/Template.txt
Normal file
18
CPP/Template.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Titre du programme
|
||||||
|
* Par Florian Goussot
|
||||||
|
* BTS CIEL 2e ann<6E>e
|
||||||
|
* Fait le 05/11/2024 <20> Nancy
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
do {
|
||||||
|
system("cls");
|
||||||
|
printf_s("\t\t\tTitre du programme\n");
|
||||||
|
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||||
|
} while (_getch() != 27);
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user