예제 #1
0
        static void Main(string[] args)
        {
            var exp = new AdditionExpression(new DoubleExpression(1),
                                             new AdditionExpression(new DoubleExpression(2), new DoubleExpression(3)));
            var sb = new StringBuilder();

            exp.Print(sb);
            WriteLine(sb.ToString());
        }
예제 #2
0
        static void Main(string[] args)
        {
            var exp = new AdditionExpression(new DoubleExpression(1),
                                             new AdditionExpression(new DoubleExpression(2), new DoubleExpression(3)));
            var sb = new StringBuilder();

            exp.Print(sb);
            WriteLine($"{sb} = {exp.Calculate()}");
        }