diff --git a/CPP/Source1.cpp b/CPP/Source1.cpp index 398093e..f408e9a 100644 --- a/CPP/Source1.cpp +++ b/CPP/Source1.cpp @@ -12,22 +12,18 @@ using namespace std; int main(void) { int a, b, c; char key; - printf("\t\t\tLe plus grand\n"); - printf("Entrez trois nombres entiers séparé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 à gauche de votre clavier ;)\n\n"); - key = _getch(); - if (key == 27) { - return 0; - } - else { - main(); - } + do { + printf("\t\t\tLe plus grand\n"); + printf("Entrez trois nombres entiers séparé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 à gauche de votre clavier ;)\n\n"); + key = _getch(); + } while (key != 27); } \ No newline at end of file