我正在从 Python 切换到 C#,但我遇到了ReadLine()
函数问题。如果我想要求用户输入 Python,我是这样做的:
x = int(input("Type any number: "))
在 C# 中,这变为:
int x = Int32.Parse (Console.ReadLine());
但是如果我输入这个我会得到一个错误:
int x = Int32.Parse (Console.ReadLine("Type any number: "));
如何要求用户在 C# 中键入内容?