Console.ReadLine Console.Read
ReadLine一次读入一行,得到的是string 用char会出错
Read一次只读入一个字符的ASSIC码,得到的类型是int
博客介绍了C#中Console.ReadLine和Console.Read的不同。ReadLine一次读入一行,结果为string类型,若用char会出错;Read一次只读入一个字符的ASSIC码,得到的类型是int。
Console.ReadLine Console.Read
ReadLine一次读入一行,得到的是string 用char会出错
Read一次只读入一个字符的ASSIC码,得到的类型是int