-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
46 lines (40 loc) · 968 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using exercices;
using Logique;
Console.OutputEncoding = System.Text.Encoding.UTF8;
int choix = -1;
String entree = "";
iCommand[] exercices = new iCommand[]
{
new InteretsCumules(),
new ExStructures2(),
new ExMethodes2(),
new ExEnums1()
};
do
{
for (int i = 0; i < exercices.Length; i++)
{
Console.WriteLine("{0,2} {1}", i + 1, exercices[i].Name);
}
Console.WriteLine("{0,2} {1}", 'q', "Quitter");
Console.WriteLine("--------------");
Console.Write("choix : ");
entree = Console.ReadLine();
if (Int32.TryParse(entree, out choix))
{
Console.Clear();
try
{
if (choix > 0 && choix <= exercices.Length)
{
exercices[choix - 1].Execute();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadKey();
Console.Clear();
}
} while (entree != "q");