我嘗試進行文本冒險,但在到達“if”部分時出現錯誤。我讓它工作了一次,但不像我想要的那樣。我稍微改變了一下,然后放棄并轉到原始腳本,但它不像上次那樣工作,而是給了我這個錯誤:cs0131 賦值的左側必須是變量、屬性或索引器這是我的代碼:Console.WriteLine("What's your name");string name = Console.ReadLine();Console.Write("Hello " + name);Console.WriteLine(" do you like games?");Console.WriteLine("yes or no");string yes = Console.ReadLine();string no = Console.ReadLine();if (Console.ReadKey() = yes) { Console.WriteLine("Great!, Lets play one"); }//the error is at "if (console.readkey()"
錯誤:cs0131 賦值的左側必須是變量、屬性或索引器
慕碼人8056858
2021-11-21 18:09:00