From c1e001cd10e52ef947c6f0c0552d0b322819f8e2 Mon Sep 17 00:00:00 2001 From: HORVILLE Ewen Date: Tue, 9 Nov 2021 13:53:20 +0100 Subject: [PATCH] Corrections exos --- APL1.1/CMB1/distribution.c | 3 +-- APL1.1/TP15/decoupage.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/APL1.1/CMB1/distribution.c b/APL1.1/CMB1/distribution.c index 431b5c0..fec15b0 100644 --- a/APL1.1/CMB1/distribution.c +++ b/APL1.1/CMB1/distribution.c @@ -31,5 +31,4 @@ int main(int argc, char * argv[]) { } return EXIT_SUCCESS; -} - +} \ No newline at end of file diff --git a/APL1.1/TP15/decoupage.c b/APL1.1/TP15/decoupage.c index 721fd72..15a13b7 100644 --- a/APL1.1/TP15/decoupage.c +++ b/APL1.1/TP15/decoupage.c @@ -25,16 +25,21 @@ int showMenu() { puts("Que voulez vous dessiner ?"); puts("1. Carré"); puts("2. Triangle"); + puts("3. Quitter"); scanf("%d", &choice); return choice; } int main(int argc, char * argv[]) { - int choice = showMenu(); + int choice; + do { + choice = showMenu(); + if (choice == 1) drawSquare(); + else if (choice == 2) drawTriangle(); + else if (choice != 3) puts("Choix incorrect."); + } while (choice != 3); - if(choice == 1) drawSquare(); - else drawTriangle(); return EXIT_SUCCESS; }