摘要: 现在我们要实现交换2个数的值,由于在程序中经常用到,所以封装到函数中代码如下1 /// <summary>2 /// 交换2个数的值3 /// </summary>4 static public void Swap(int x1, int x2)5 {6 int temp = x1;7 x1 = x2;8 x2 = temp;9 }在打印出2个数的值1 static void Main(string[] args)2 {3 int x... 阅读全文