static void Main(string[] args) { Stopwatch s = new Stopwatch(); s.Start(); IMyList myList = new MyList(); for (int i = 0; i < 100000000; i++) { myList.Add(i); } Console.WriteLine(s.Elapsed); }
static void Main1(string[] args) { IMyList myList = new MyList(); string a; do { a = Console.ReadLine(); int b = int.Parse(Console.ReadLine()); switch (a) { case "a": myList.Add(b); break; case "g": Console.WriteLine(myList.Get(b)); break; } } while (a!= "q"); }