using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 函数的参数 { class Program { static void mm(int x, int y) { Console.WriteLine("传入函数mm的参数为:x = {0},y = {1}",x,y); //以下这三句代码为:交换两个参数的值 int temp = x; x = y; y = temp; Console.WriteLine("在执行函数mm后输出的参数值为:x = {0},y = {1}",x,y); } static void Main(string[] args) { int i = 21, j = 34; Console.WriteLine("在Main方法中调用mm函数传入两个参数:i = {0},j = {1}",i,j); mm(i,j); Console.WriteLine("在Main中执行完mm函数之后:i = {0},j = {1}",i,j); Console.ReadKey(); } } }