私はC#を初めて使用しますが、このコードの何が問題になっているのか理解できません。私はクイズを作成していて、答えが正しければよくできていると言おうとしていますが、文字列型をbool型に暗黙的に変換することはできません。
これが私のコードです:
{
int score = 0;
Console.WriteLine(" What is your name?");
string name = "";
name = Console.ReadLine();
Console.WriteLine("Hello " +name+ " and welcome to the Formula 1 quiz.");
Console.ReadLine();
Console.WriteLine("Question 1: How many races has Michael Schumacher won.");
Console.ReadLine();
Console.WriteLine("a) 91");
Console.WriteLine("b) 51");
Console.WriteLine("c) 41");
Console.WriteLine("d) 31");
Console.ReadLine();
string answer = Console.ReadLine();
if (answer = a) Console.WriteLine("Well done");
else Console.WriteLine("Wrong answer");
}