Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
785 B
1
Indexable
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());

        }
    }
}