Console.Read() and Console.ReadLine() FormatException
问题 using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Int32 a = 3; Int32 b = 5; a = Console.Read(); b = Convert.ToInt32(Console.ReadLine()); Int32 a_plus_b = a + b; Console.WriteLine("a + b =" + a_plus_b.ToString()); } } } I get an error message at the ReadLine() function: FormatException was unhandled. What is the problem? 回答1: I guess it is just because you pressing ENTER key after you type first number . Lets analyze your code. Your code reads the