Corrections exos

This commit is contained in:
HORVILLE 2021-11-09 13:53:20 +01:00
parent 5b66e31981
commit c1e001cd10
2 changed files with 9 additions and 5 deletions

View File

@ -31,5 +31,4 @@ int main(int argc, char * argv[]) {
}
return EXIT_SUCCESS;
}
}

View File

@ -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;
}