using System; namespace CalculatorApplication { class NumberManipulator { public void getValues(out int x, out int y) { //Console.WriteLine("请输入第一个值: "); //x = Convert.ToInt32(Console.ReadLine()); //Console.WriteLine("请输入第二个值: "); //y = Convert.ToInt32(Console.ReadLine()); x = 150; y = 123; } static void Main(string[] args) { NumberManipulator n = new NumberManipulator(); /* 局部变量定义 */ int a, b; /* 调用函数来获取值 */ n.getValues(out a, out b); Console.WriteLine("在方法调用之后,a 的值: {0}", a); Console.WriteLine("在方法调用之后,b 的值: {0}", b); Console.ReadLine(); } } }