1、變量交換spa
int a = 10; int b = 5; Console.WriteLine("開始a={0},b={1}",a,b); a = a + b; b = a - b; a = a - b; Console.WriteLine("交換後a={0},b={1}",a,b);
2、Console.ReadLine()code
Console.WriteLine("在輸入語句前:"); string input = Console.ReadLine(); Console.WriteLine("在輸入語句後。"); Console.WriteLine(input);