using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 值传递 { class Program { static void fun(int x, int y) { x = x + 1; y = y - 1; } static void Main(string[] args) { int m = 3; int n = 4; Console.WriteLine("调用前m = {0}, n = {1}",m,n); fun(m,n); Console.WriteLine("调用后m = {0}, n = {1}",m,n); Console.ReadKey(); } } }