-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
84 lines (79 loc) · 2.99 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using System;
using Problems;
namespace DailyCodingProblems
{
class Program
{
public static void Main(string[] args)
{
CreateHeader();
while (true) {
Console.WriteLine("Input problem #:");
string userInput = "lis";
int problemNumber = 0;
if (userInput == "sort") {
SortingAlgorithms SortingAlgorithms = new SortingAlgorithms();
SortingAlgorithms.Main();
}
else if (userInput == "LinkedList") {
LinkedListTest linkedList = new LinkedListTest();
linkedList.Main();
}
else if (userInput == "Fib") {
Fib fib = new Fib();
fib.Main();
}
else if (userInput == "lis") {
LISS lis = new LISS();
lis.Main();
}
else if (userInput == "search") {
SearchingAlgorithms search = new SearchingAlgorithms();
search.Main();
}
else
{
bool validInput = Int32.TryParse(userInput, out problemNumber);
if (validInput) {
switch (problemNumber) {
case 1:
Problem1 problem1 = new Problem1();
problem1.Main();
break;
case 21:
Problem21 problem21 = new Problem21();
problem21.Main();
break;
case 29:
Problem29 problem29 = new Problem29();
problem29.Main();
break;
case 37:
Problem37 problem37 = new Problem37();
problem37.Main();
break;
case 44:
Problem44 problem44 = new Problem44();
problem44.Main();
break;
case 57:
Problem57 problem57 = new Problem57();
problem57.Main();
break;
default:
break;
}
}
}
}
}
static void CreateHeader ()
{
const string headerText = "Daily Coding Challenges";
Console.WriteLine();
Console.WriteLine(headerText);
Console.WriteLine(new String('-', headerText.Length));
Console.WriteLine();
}
}
}