static void Main(string[] args) { People p = new People(); Calcuror c = new Calcuror(); p.Use(c); }
public void Use(Calcuror c) { Console.Write("请输入第一个数字:"); double number1; number1 = double.Parse(Console.ReadLine()); Console.Write("请输入第二个数字:"); double number2; number2 = double.Parse(Console.ReadLine()); Console.Write("请输入运算符:"); char oper; oper = char.Parse(Console.ReadLine()); c.Calculate(number1, number2, oper); }