示例#1
0
        static void Main(string[] args)
        {
            Operation oper;

            oper         = OperationFactory.CreateOperate("+");
            oper.NumberA = 1;
            oper.NumberB = 2;
            double result = oper.GetResult();

            Console.WriteLine(result);
        }
示例#2
0
        static void Main(string[] args)
        {
            Operation oper;

            oper         = OperationFactory.createOperate("/");
            oper.NumberA = 2;
            oper.NumberB = 1;

            double result = oper.GetResult();

            Console.Write(result);
            Console.Read();
        }