From f5c501e5a66e9c7359aaaa006315afa29eeb9b33 Mon Sep 17 00:00:00 2001 From: Le Stagiaire Date: Tue, 24 Sep 2024 16:33:21 +0200 Subject: [PATCH] Remplacement de Source1.cpp par Source2.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le fichier `CPP.vcxproj` a été modifié pour remplacer `Source1.cpp` par `Source2.cpp` dans la section ``. Le fichier `CPP.vcxproj.filters` a également été modifié pour remplacer `Source1.cpp` par `Source2.cpp` dans la section ``, sous le filtre `Fichiers sources`. Dans `Source1.cpp`, la ligne `system("color 0a");` a été supprimée. Un nouveau fichier `Source2.cpp` a été ajouté avec un programme complet qui demande à l'utilisateur d'entrer une note entre 0 et 20, puis affiche un commentaire basé sur la note entrée. Le programme continue de demander des notes jusqu'à ce que l'utilisateur appuie sur la touche Échap pour quitter. --- CPP/CPP.vcxproj | 2 +- CPP/CPP.vcxproj.filters | 2 +- CPP/Source1.cpp | 1 - CPP/Source2.cpp | 30 ++++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 CPP/Source2.cpp diff --git a/CPP/CPP.vcxproj b/CPP/CPP.vcxproj index 50ad003..0d92fca 100644 --- a/CPP/CPP.vcxproj +++ b/CPP/CPP.vcxproj @@ -19,7 +19,7 @@ - + 17.0 diff --git a/CPP/CPP.vcxproj.filters b/CPP/CPP.vcxproj.filters index b310d38..22c475c 100644 --- a/CPP/CPP.vcxproj.filters +++ b/CPP/CPP.vcxproj.filters @@ -15,7 +15,7 @@ - + Fichiers sources diff --git a/CPP/Source1.cpp b/CPP/Source1.cpp index 21c7a2c..61de357 100644 --- a/CPP/Source1.cpp +++ b/CPP/Source1.cpp @@ -14,7 +14,6 @@ int main(void) { int a, b, c; do { system("cls"); - system("color 0a"); printf("\t\t\tLe plus grand\n"); printf("Entrez trois nombres entiers séparés par des espaces : "); scanf_s("%d %d %d", &a, &b, &c); diff --git a/CPP/Source2.cpp b/CPP/Source2.cpp new file mode 100644 index 0000000..dc62efc --- /dev/null +++ b/CPP/Source2.cpp @@ -0,0 +1,30 @@ +/* + * Programme de commentaires de notes + * Par Florian Goussot + * BTS CIEL 2e année + * Fait le 24/09/2024 à Nancy +*/ +#include +#include +#include + +int main(void) { + do { + float note; + system("cls"); + printf_s("\t\t\tProgramme de commentaires de notes\n"); + do { + printf_s("Entrez une note comprise entre 0 et 20 : "); + scanf_s("%f", ¬e); + } while (note < 0 || note > 20); + if (note >= 0 && note < 10) { + printf_s("\nAttention ! Il faut se ressaisir !!"); + } else if (note >= 10 && note <= 16) { + printf_s("\nEncore un petit effort !"); + } else { + printf_s("\nTrès bien, mais sans plus !"); + } + printf_s("\n\nAppuyez sur Echap pour quitter..."); + } while (_getch() != 27); + return 0; +} \ No newline at end of file