Untitled
using System; using System.Collections.Generic; namespace stack_2 { class Program { static void Main(string[] args) { Console.WriteLine("Въведете математически израз"); string abc = Console.ReadLine(); Stack<char> myStack = new Stack<char>(); string openBrc = "{[("; string closeBrc = ")]}"; for (int i = 0; i < abc.Length; i++) { if (openBrc.Contains(abc)) myStack.Push(abc[i]); else if (closeBrc.Contains(abc[i])) { } } while (myStack.Count > 0) Console.WriteLine(myStack.Pop()); } } }