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()); }
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()}"); }