我不明白为什么我的整数没有正确出来,Console.Read()方法说它返回一个整数,为什么WriteLine没有正确显示它?
int dimension;
dimension = Console.Read();
Console.WriteLine(""+ dimension);
Console.Read()只返回键入内容的第一个字符.你应该使用Console.ReadLine():
例:
int suppliedInt;
Console.WriteLine("Please enter a number greater than zero");
Int32.TryParse(Console.ReadLine(), out suppliedInt);
if (suppliedInt > 0) {
    Console.WriteLine("You entered: " + suppliedInt);
}
else {
    Console.WriteLine("You entered an invalid number. Press any key to exit");
}
Console.ReadLine();
其他资源:
MSDN  -  Console.Read()
MSDN  -  Console.ReadLine()