예제 #1
0
        private static double Calculate(string str)
        {
            List <double> result = new List <double>();

            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsDigit(str[i]))
                {
                    string num = "";
                    while (char.IsDigit(str[i]))
                    {
                        num += str[i];
                        i++;
                    }
                    result.Add(Convert.ToDouble(num));
                }
                else if (Rpn.IsSign(str[i]))
                {
                    double num1 = result[^ 1];