static void Main(string[] args) { CollectionType <task> Task = new CollectionType <task>(); GetStack forstack = new GetStack(); GetStack forstack2 = new GetStack(); GetStack forstack3 = new GetStack(); try { forstack = 3 + forstack; int count = 0; foreach (int value in forstack.myStack) { count++; Console.WriteLine("elem #" + count + ": " + value); } Console.WriteLine("------------After .Pop-------------"); forstack--; count = 0; foreach (int value in forstack.myStack) { count++; Console.WriteLine("elem #" + count + ": " + value); } if (true) { Console.WriteLine("Stack isn't empty"); } forstack3 = forstack > forstack2; //--------------------------------------- Console.WriteLine("Средний элемент #" + forstack.myStack.CountPoint() + "\nКол-во строк в стеке: " + forstack.myStack.CountPointElem()); File.WriteAllText("E:\\2 kurs\\ООП\\2-kurs\\Labs\\Lab_8\\Lab_8\\new.txt", forstack2.ToString()); MakeId.UnderMakeId owner = new MakeId.UnderMakeId(); owner.UnderMakeID(); } catch { } finally { Console.WriteLine("This is finally"); } }
static void Main(string[] args) { GetStack forstack = new GetStack(); GetStack forstack2 = new GetStack(); GetStack forstack3 = new GetStack(); forstack = 3 + forstack; int count = 0; foreach (int value in forstack.myStack) { count++; Console.WriteLine("elem #" + count + ": " + value); } Console.WriteLine("------------After .Pop-------------"); forstack--; count = 0; foreach (int value in forstack.myStack) { count++; Console.WriteLine("elem #" + count + ": " + value); } if (true) { Console.WriteLine("Stack isn't empty"); } forstack3 = forstack > forstack2; //--------------------------------------- Console.WriteLine("Средний элемент #" + forstack.myStack.CountPoint() + "\nКол-во строк в стеке: " + forstack.myStack.CountPointElem()); MakeId.UnderMakeId owner = new MakeId.UnderMakeId(); owner.UnderMakeID(); }