Exemplo n.º 1
0
        static void Main()
        {
            double selection;

            do
            {
                Console.WriteLine("3,1 LOST.");
                Console.WriteLine("3,2 WORD FREQUENCY.");
                Console.WriteLine("3,3 DYNAMIC ARRAY AND HARDCORE MODE.");
                Console.WriteLine("3,4 CYCLED ARRAY.");
                Console.WriteLine("0 Exit.");
                Console.WriteLine();
                if (double.TryParse(Console.ReadLine(), out selection))
                {
                    switch (selection)
                    {
                    case 3.1:
                        Lost.Read();
                        break;

                    case 3.2:
                        var txt = WordFrequency.Read();
                        Dictionary <string, int> result = WordFrequency.WordFrequence(txt);
                        WordFrequency.Show(result);
                        break;

                    case 3.3:

                        DynamicArray <int> .Show();

                        Console.WriteLine();
                        DynamicArrayHardcoreMode <int> .ShowHM();

                        break;

                    case 3.4:
                        var vs = new CycledDynamicArray <int>(new List <int> {
                            1, 2, 3, 4, 5
                        }, 5);
                        foreach (var item in vs)
                        {
                            Console.WriteLine(item);
                        }
                        break;

                    case 0:
                        break;
                    }
                }
            } while (selection != 0);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //Lost lost = new Lost();
            //lost.Method();

            //DynamicArray<int> ar = new DynamicArray<int>();
            //ar.Add(0);
            //ar.Add(2);
            //ar.Insert(6, 1);

            //foreach (var item in ar)
            //{
            //    Console.WriteLine(item);
            //}
            //Console.ReadLine();

            WordFrequency test = new WordFrequency();

            test.FindWords();
            Console.ReadKey();
        }