//#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace daichaoyu { class Program { static void Main(string[] args) { int number1 = 10; int number2 = 5; //交换前输出 Console.WriteLine("number:" + number1 + ",number2:"+number2 ); int temp; temp = number1;// temp--10 number1 --10 number2 ---5 number1 = number2;// temp--10 number1 --5 number2 ---5 number2 = temp ;// temp--10 number1 --5 number2 ---10 //交换后输出 Console.WriteLine("number:" + number1 + ",number2:"+number2); Console.ReadKey(); } } }
戴超宇
网友评论