Compare commits
10 Commits
b0d5c1a59b
...
master
Author | SHA1 | Date | |
---|---|---|---|
65bbf7b4cd | |||
838f7415fb | |||
f56d985cad | |||
f5c501e5a6 | |||
ea62c94a2a | |||
d1b9b4c1aa | |||
b3e388dac5 | |||
79b2cfda35 | |||
a9c9b2df56 | |||
e81dc863f1 |
31
CPP.sln
Normal file
31
CPP.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CPP", "CPP\CPP.vcxproj", "{250A8975-78CC-4FA3-B0C8-784AA4DF439F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Debug|x64.Build.0 = Debug|x64
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Release|x64.ActiveCfg = Release|x64
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Release|x64.Build.0 = Release|x64
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{250A8975-78CC-4FA3-B0C8-784AA4DF439F}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F45B57BB-4E21-469D-89F6-112541AD1FCA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
138
CPP/CPP.vcxproj
Normal file
138
CPP/CPP.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Source8.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Template.txt" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{250a8975-78cc-4fa3-b0c8-784aa4df439f}</ProjectGuid>
|
||||
<RootNamespace>CPP</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
CPP/CPP.vcxproj.filters
Normal file
27
CPP/CPP.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Fichiers sources">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers d%27en-tête">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers de ressources">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Source8.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Template.txt">
|
||||
<Filter>Fichiers de ressources</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
</Project>
|
25
CPP/Source.cpp
Normal file
25
CPP/Source.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Programme de d<>tection de chiffre pairs et impairs
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 10/09/2024 <20> Nancy
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(void) {
|
||||
int nbr;
|
||||
printf("\t\t\tPair ou impair ?\n");
|
||||
printf("Entrez un nombre entier : ");
|
||||
scanf_s("%d", &nbr);
|
||||
//printf(nbr % 2 == 0 ? "Le nombre est pair !" : "Le nombre est impair !");
|
||||
if (nbr % 2) {
|
||||
printf("Le nombre est impair !");
|
||||
}
|
||||
else {
|
||||
printf("Le nombre est pair !");
|
||||
}
|
||||
return 0;
|
||||
}
|
30
CPP/Source1.cpp
Normal file
30
CPP/Source1.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Programme d'affichage du plus grand nombre parmis 3 propositions
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 10/09/2024 <20> Nancy
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(void) {
|
||||
int a, b, c;
|
||||
do {
|
||||
system("cls");
|
||||
printf("\t\t\tLe plus grand\n");
|
||||
printf("Entrez trois nombres entiers s<>par<61>s par des espaces : ");
|
||||
scanf_s("%d %d %d", &a, &b, &c);
|
||||
if (b < c) {
|
||||
b = c;
|
||||
}
|
||||
if (a < b) {
|
||||
a = b;
|
||||
}
|
||||
printf("Le nombre le plus grand est %d", a);
|
||||
printf("\n\nPour quitter, frappez la touche en haut <20> gauche de votre clavier ;)\n\n");
|
||||
} while (_getch() != 27);
|
||||
return 0;
|
||||
}
|
30
CPP/Source2.cpp
Normal file
30
CPP/Source2.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Programme de commentaires de notes
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 24/09/2024 <20> Nancy
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
|
||||
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<EFBFBD>s bien, mais sans plus !");
|
||||
}
|
||||
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||
} while (_getch() != 27);
|
||||
return 0;
|
||||
}
|
28
CPP/Source3.cpp
Normal file
28
CPP/Source3.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Programme d'affichage du plus grand nombre parmis 3 propositions
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 24/09/2024 <20> Nancy
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
do {
|
||||
int mois;
|
||||
system("cls");
|
||||
printf_s("\t\t\tProgramme donnant le nombre de jours par mois");
|
||||
printf_s("\nEntrez le num<75>ro du mois : ");
|
||||
scanf_s("%i", &mois);
|
||||
if (mois == 1 || mois == 3 || mois == 5 || mois == 7 || mois == 8 || mois == 10 || mois == 12) {
|
||||
printf_s("\nCe mois comporte 31 jours");
|
||||
}else if (mois == 2) {
|
||||
printf_s("\nCe mois comporte 28 ou 29 jours");
|
||||
}
|
||||
else {
|
||||
printf_s("\nCe mois comporte 30 jours");
|
||||
}
|
||||
} while (_getch() != 27);
|
||||
return 0;
|
||||
}
|
41
CPP/Source4.cpp
Normal file
41
CPP/Source4.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Programme d'affichage du plus grand nombre parmis 3 propositions
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 24/09/2024 <20> Nancy
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
do {
|
||||
int mois;
|
||||
system("cls");
|
||||
printf_s("\t\t\tProgramme donnant le nombre de jours par mois");
|
||||
printf_s("\nEntrez le num<75>ro du mois : ");
|
||||
scanf_s("%i", &mois);
|
||||
if (mois < 1 || mois > 12) {
|
||||
printf_s("\nVeuillez entrer un num<75>ro de mois valide !");
|
||||
continue;
|
||||
}
|
||||
switch (mois){
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 10:
|
||||
case 12:
|
||||
printf_s("\nCe mois comporte 31 jours");
|
||||
break;
|
||||
case 2:
|
||||
printf_s("\nCe mois comporte 28 ou 29 jours");
|
||||
break;
|
||||
default:
|
||||
printf_s("\nCe mois comporte 30 jours");
|
||||
break;
|
||||
}
|
||||
} while (_getch() != 27);
|
||||
return 0;
|
||||
}
|
24
CPP/Source5.cpp
Normal file
24
CPP/Source5.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Programme d'affichage De la table ASCII
|
||||
* Par Florian Goussot
|
||||
* BTS CIEL 2e ann<6E>e
|
||||
* Fait le 08/10/2024 <20> Nancy
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
do {
|
||||
system("cls");
|
||||
printf_s("\t\t\tAffichage de la table ASCII\n");
|
||||
for (int i = 15; i < 255; i++) {
|
||||
printf_s("\t%c : %3i\t", char(i), i);
|
||||
if (i % 6 == 0) {
|
||||
printf_s("\n");
|
||||
}
|
||||
}
|
||||
printf_s("\n\nAppuyez sur Echap pour quitter...");
|
||||
} while (_getch() != 27);
|
||||
return 0;
|
||||
}
|
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;
|
||||
}
|
38
CPP/Source8.cpp
Normal file
38
CPP/Source8.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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>
|
||||
#include <locale>
|
||||
|
||||
int main(void) {
|
||||
do {
|
||||
setlocale(LC_CTYPE, "fr");
|
||||
system("cls");
|
||||
printf_s("\t\t\tProgramme de calcul des nombres premiers\n");
|
||||
printf_s("Donnez le nombre limite (>3) : ");
|
||||
int limite = 3;
|
||||
scanf_s("%d", &limite);
|
||||
printf_s("Nombre premiers trouv<75>s : \n\t1\t2\t");
|
||||
for (int i = 3; i <= limite; i += 2) {
|
||||
int nb_diviseurs = 0;
|
||||
for (int j = 3; j <= i / 2; j += 2) {
|
||||
if ((i % j) == 0) {
|
||||
nb_diviseurs++;
|
||||
}
|
||||
if (nb_diviseurs > 2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (nb_diviseurs <= 2) {
|
||||
printf_s("%i\t", i);
|
||||
}
|
||||
}
|
||||
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