Ejemplo n.º 1
0
    public static void Main()
    {
        StackOfStrings stack = new StackOfStrings();

        stack.Push("Pesho");
        stack.Push("Ivan");
        stack.Push("Gosho");

        Console.WriteLine(stack.Peek());
        Console.WriteLine(stack.IsEmpty());
        stack.Pop();
        stack.Pop();
        stack.Pop();
        Console.WriteLine(stack.IsEmpty());
    }
Ejemplo n.º 2
0
        public static void Main()
        {
            var customStack = new StackOfStrings();

            customStack.AddRange("");
            System.Console.WriteLine(customStack.IsEmpty());
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            /*
             * var randomList = new RandomList();
             *
             * randomList.Add(1);
             * randomList.Add(2L);
             * randomList.Add(3.0);
             * randomList.Add(true);
             * randomList.Add("5");
             *
             * Console.WriteLine(randomList.RandomString());
             */

            var stackOfStrings = new StackOfStrings();

            stackOfStrings.Push("1");
            stackOfStrings.Push("2");
            stackOfStrings.Push("3");

            Console.WriteLine(stackOfStrings.Peek());
            Console.WriteLine(stackOfStrings.Pop());
            Console.WriteLine(stackOfStrings.Peek());
            Console.WriteLine(stackOfStrings.IsEmpty());
        }
Ejemplo n.º 4
0
    private static void Main(string[] args)
    {
        var stringStack = new StackOfStrings();
        var item        = "item";

        stringStack.Push(item);
        stringStack.Pop();
        stringStack.Peek();
        stringStack.IsEmpty();
    }
Ejemplo n.º 5
0
    static void Main(string[] args)
    {
        List <string> newList = Console.ReadLine().Split().ToList();
        var           stack   = new StackOfStrings(newList);

        stack.Push("pesho");
        Console.WriteLine(stack.Peek());
        Console.WriteLine(stack.Pop());
        Console.WriteLine(stack.Pop());
        Console.WriteLine(stack.IsEmpty());
    }
Ejemplo n.º 6
0
    static void Main()
    {
        // test class StackOfStrings

        var myStack = new StackOfStrings();

        myStack.Push("a");
        myStack.Push("b");
        myStack.Push("c");
        myStack.Pop();
        string peek    = myStack.Peek();
        bool   isEmpty = myStack.IsEmpty();
    }
Ejemplo n.º 7
0
    static void Main(string[] args)
    {
        StackOfStrings list = new StackOfStrings();

        list.Push("Nasko");
        list.Push("Asi");
        list.Push("Ivan");
        list.Push("Matiq");

        Console.WriteLine(list.Pop());
        Console.WriteLine(list.Peek());
        Console.WriteLine(list.IsEmpty());
    }
Ejemplo n.º 8
0
    public static void Main()
    {
        List <string> test = new List <string>
        {
            "Gosho",
            "Pesho",
            "Ivan"
        };

        StackOfStrings newstack = new StackOfStrings(test);

        newstack.Peek();
        newstack.IsEmpty();
        newstack.Pop();
        newstack.Push("aas");
    }
Ejemplo n.º 9
0
    static void Main()
    {
        StackOfStrings stack = new StackOfStrings();

        stack.Push("kur");
        stack.Push("putka");
        stack.Pop();
        stack.Pop();
        if (!stack.IsEmpty())
        {
            foreach (var item in stack.Stack)
            {
                Console.WriteLine(item);
            }
        }
    }
Ejemplo n.º 10
0
    public static void Main()
    {
        var data = new StackOfStrings();

        data.Push("one");

        Console.WriteLine(data.IsEmpty());
        try
        {
            Console.WriteLine(data.Pop());
            Console.WriteLine(data.Peek());
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }