First commit
This commit is contained in:
BIN
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/6.6.3
Normal file
BIN
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/6.6.3
Normal file
Binary file not shown.
29
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/functions.cpp
Normal file
29
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/functions.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "functions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void ordreCroissant(float a, float b, float c) {
|
||||
if (a < b) {
|
||||
if (b > c) {
|
||||
cout << c << b << a;
|
||||
} else {
|
||||
if (a > c) {
|
||||
cout << b << c << a;
|
||||
} else {
|
||||
cout << b << a << c;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (a > c) {
|
||||
cout << c << a << b;
|
||||
} else {
|
||||
if (b < c) {
|
||||
cout << a << b << c;
|
||||
} else {
|
||||
cout << a << c << b;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/functions.h
Normal file
10
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/functions.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Affiche abc dans l'odre croissant
|
||||
|
||||
Args
|
||||
a, b, c : 3 float
|
||||
|
||||
Returns
|
||||
void
|
||||
*/
|
||||
void ordreCroissant(float a, float b, float c);
|
||||
BIN
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/main
Normal file
BIN
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/main
Normal file
Binary file not shown.
15
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/main.cpp
Normal file
15
IUT/Info1/TD/Exercices/6.6.3_imbrication_si/main.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "functions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
float a, b, c;
|
||||
|
||||
cout << "Entrez a, b, c" << endl;
|
||||
cin >> a >> b >> c;
|
||||
|
||||
ordreCroissant(a, b, c);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user