First commit
This commit is contained in:
28
IUT/Info1/TD/Exercices/6.5_conditions_multiples/6.5.txt
Normal file
28
IUT/Info1/TD/Exercices/6.5_conditions_multiples/6.5.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
{
|
||||
R : Verifier que le nombre saisi est entre 1 et 50 inclus
|
||||
E : nombre : un entier
|
||||
S : l'info si le nombre est correct un booléen
|
||||
}
|
||||
estEntre1Et50 : une fonction ( : un entier) -> booléen
|
||||
Lexique : {Local à estEntre1Et50}
|
||||
|
||||
Algorithme : {Local à estEntre1Et50}
|
||||
Début
|
||||
Si nb >= 1 ET nb <= 50
|
||||
Alors Retourner VRAI
|
||||
Sinon Retourner FAUX
|
||||
Fin Si
|
||||
Fin
|
||||
|
||||
|
||||
6.6
|
||||
ProduitNegatif : une fonction (a : un réel, b : un réel) -> booléen
|
||||
Si a < 0
|
||||
Alors Si b < 0
|
||||
Alors Retourner FAUX
|
||||
Sinon Retourner VRAI
|
||||
Sinon Si b < 0
|
||||
Alors Retourner VRAI
|
||||
Sinon Retourner FAUX
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "functions.h"
|
||||
|
||||
bool estEntre1Et50(int nombre) {
|
||||
if (nombre >= 1 && nombre <= 50) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// Verifie si nombre est entre 1 et 50 inclus
|
||||
bool estEntre1Et50(int);
|
||||
9
IUT/Info1/TD/Exercices/6.5_conditions_multiples/main.cpp
Normal file
9
IUT/Info1/TD/Exercices/6.5_conditions_multiples/main.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "functions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user