diff options
| author | Gaspard Coulet <gaspard.coulet@mines-ales.org> | 2021-04-28 23:05:53 +0200 |
|---|---|---|
| committer | Gaspard Coulet <gaspard.coulet@mines-ales.org> | 2021-04-28 23:05:53 +0200 |
| commit | 9fe033ea88c2f705ec18c232873d056e0c229d72 (patch) | |
| tree | 0647dc8c51610c7336c88c04de2068ea14b21e17 /sem_2/HLIN202/TP/TP1 | |
Initial commit
Diffstat (limited to 'sem_2/HLIN202/TP/TP1')
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/autres/firstprog | bin | 0 -> 9140 bytes | |||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/autres/firstprog.cpp | 7 | ||||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/autres/secondprog | bin | 0 -> 9141 bytes | |||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/autres/secondprog.cpp | 12 | ||||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/ex56/exo56 | bin | 0 -> 9354 bytes | |||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/ex56/exo56.cpp | 12 | ||||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/ex7/exo7conv | bin | 0 -> 13448 bytes | |||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp | 22 | ||||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/nbparfait/parfait | bin | 0 -> 9295 bytes | |||
| -rw-r--r-- | sem_2/HLIN202/TP/TP1/nbparfait/parfait.cpp | 21 |
10 files changed, 74 insertions, 0 deletions
diff --git a/sem_2/HLIN202/TP/TP1/autres/firstprog b/sem_2/HLIN202/TP/TP1/autres/firstprog Binary files differnew file mode 100644 index 0000000..4e0a5f5 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/autres/firstprog diff --git a/sem_2/HLIN202/TP/TP1/autres/firstprog.cpp b/sem_2/HLIN202/TP/TP1/autres/firstprog.cpp new file mode 100644 index 0000000..5440e7b --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/autres/firstprog.cpp @@ -0,0 +1,7 @@ +#include <iostream> + +int main(){ + std::cout<<"Félicitation, vous avez réussi à compiler et exécuter un programme C++"<<std::endl; + + return 0; +} diff --git a/sem_2/HLIN202/TP/TP1/autres/secondprog b/sem_2/HLIN202/TP/TP1/autres/secondprog Binary files differnew file mode 100644 index 0000000..c3aeebf --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/autres/secondprog diff --git a/sem_2/HLIN202/TP/TP1/autres/secondprog.cpp b/sem_2/HLIN202/TP/TP1/autres/secondprog.cpp new file mode 100644 index 0000000..1980255 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/autres/secondprog.cpp @@ -0,0 +1,12 @@ +#include <iostream> + +int main(){ + + int a,b; + a=5; + b=8; + + std::cout<<"Félicitation, vous avez réussi à corriger un programme C++"<<std::endl; + + return 0; +} diff --git a/sem_2/HLIN202/TP/TP1/ex56/exo56 b/sem_2/HLIN202/TP/TP1/ex56/exo56 Binary files differnew file mode 100644 index 0000000..572237e --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/ex56/exo56 diff --git a/sem_2/HLIN202/TP/TP1/ex56/exo56.cpp b/sem_2/HLIN202/TP/TP1/ex56/exo56.cpp new file mode 100644 index 0000000..6aabf90 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/ex56/exo56.cpp @@ -0,0 +1,12 @@ +#include <iostream> + +int main(){ + int a, b; + std::cout<< " Entrez a puis b" << std::endl; + std::cin>>a >> b; + std::cout<<"a*b = "<< a*b <<std::endl; + std::cout<<"a+b = " << a + b << std::endl; + std::cout<<"adresse de a : " << &a << " a vaut : " <<a<< "\nadresse de b : " << &b << " b vaut : " <<b << std::endl; + + return 0; +} diff --git a/sem_2/HLIN202/TP/TP1/ex7/exo7conv b/sem_2/HLIN202/TP/TP1/ex7/exo7conv Binary files differnew file mode 100644 index 0000000..fe731d5 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/ex7/exo7conv diff --git a/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp b/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp new file mode 100644 index 0000000..3519b24 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/ex7/exo7conv.cpp @@ -0,0 +1,22 @@ +#include <iostream> + +int main(){ + float a,c; + int b=1; + std::cout<< " Entrez une temperature en fahrenheit ou en celcius" << std::endl; + std::cin>>a; + std::cout<<"Est ce en fahrenheit (1) ou en celcius(2)?"<<std::endl; + std::cin >> b; + if ( b == 1) { + c = ( a - 32 )* (5.0/9.0); + std::cout<<a << " Fahrenheit vaut " << c << " Celcius"<<std::endl; + } + else if ( b == 2 ) { + c = 9.0/5.0 * a + 32; + std::cout<<a<< " Celcius vaut " << c << " Farhenheit " << std::endl; + } + else { + std::cout<< " Unite incorrecte"<<std::endl; + } + return 0; +} diff --git a/sem_2/HLIN202/TP/TP1/nbparfait/parfait b/sem_2/HLIN202/TP/TP1/nbparfait/parfait Binary files differnew file mode 100644 index 0000000..2369d66 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/nbparfait/parfait diff --git a/sem_2/HLIN202/TP/TP1/nbparfait/parfait.cpp b/sem_2/HLIN202/TP/TP1/nbparfait/parfait.cpp new file mode 100644 index 0000000..6992c95 --- /dev/null +++ b/sem_2/HLIN202/TP/TP1/nbparfait/parfait.cpp @@ -0,0 +1,21 @@ +#include <iostream> +#include <math.h> + +int main(){ + int n, som; + std::cout<<" Ce programme calcule les nombre parfaits inferieurs ou egaux a n, entrez n :"<<std::endl; + std:: cin >> n; + std::cout << " Les nombres parfaits inferieur ou egaux a " << n << " sont : " <<std::endl; + for ( int i = 4; i <= n; i ++) { + som = 1; + for ( int j=2; j <= i/2+1 ; j ++ ) { + if ( i % j== 0 ) { + som += j; + } + } + if ( som == i ) { + std::cout << som << std::endl; + } + } + return 0; +} |
