int number1, number2;
number1 = 10;
number2 = 5;
Console.WriteLine("交换前:number1={0},number2={1}", number1, number2);
number1 = number1 + number2;
number2 = number1 - number2;
number1 = number1 - number2;
Console.WriteLine("交换后:number1={0},number2={1}", number1, number2);
Console.ReadKey();
3
网友评论