A voir également:
- Langage c ++
- Langage ascii - Guide
- Langage binaire - Guide
- Pascal langage - Télécharger - Édition & Programmation
- Langage visual basic - Télécharger - Langages
- Langage basic gratuit - Télécharger - Édition & Programmation
2 réponses
Salut c'est une petite méthode.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int min = 0, max = 0, nombre = 0,i = 0;
while(i < 20)
{
cout << "Tappez un nombre : ";
cin >> nombre;
while(nombre <= 0)
{
cout << "Ignore, Tappez un nombre plus grand que 0 : ";
cin >> nombre;
}
if(nombre > max)
max = nombre;
if(nombre < min)
min = nombre;
}
system("PAUSE");
return EXIT_SUCCESS;
}
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int min = 0, max = 0, nombre = 0,i = 0;
while(i < 20)
{
cout << "Tappez un nombre : ";
cin >> nombre;
while(nombre <= 0)
{
cout << "Ignore, Tappez un nombre plus grand que 0 : ";
cin >> nombre;
}
if(nombre > max)
max = nombre;
if(nombre < min)
min = nombre;
}
system("PAUSE");
return EXIT_SUCCESS;
}