Console.WriteLine("输入任意整数"); var n = int.Parse(Console.ReadLine()); var num = Math.Abs(n); Console.WriteLine(num); Console.ReadLine();