예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter an expression to calculate: ");
            var    input = Console.ReadLine();
            double actual;

            try
            {
                actual = ReversePolishСalculator.Сalculator(input);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return;
            }
            Console.WriteLine($"Result: {actual}");
        }
예제 #2
0
        public void CalcStringTest(string input, int exp)
        {
            double actual = ReversePolishСalculator.Сalculator(input);

            Assert.AreEqual(exp, actual);
        }