小白一个,这段代码提示无法为方法组赋值,我该怎么做?

新手上路,请多包涵

namespace OperatorsAppl
{

class Program
{
    static void Main(string[] args)
    {
        string str =   Console.ReadLine("");
        Console.WriteLine("用户输入:"+str);
        Console.Readkey();
    }
}

}

阅读 3.8k
1 个回答
新手上路,请多包涵

首先,你的代码是存在错误

string str =   Console.ReadLine(""); 

这一句,Console.ReadLine();是不具有参数的,你带了 一个字符串参数。正确写法应该是

string str = Console.ReadLine();

而且你 这一句里也是错的

Console.Readkey();

'k'请大写。