提供第一个输入后,我必须按两次回车。我在代码中做错了什么:
public static void Ifcondition()
{
string answer,value1;
Console.Clear();
Console.WriteLine("Would you like to enter your Name");
answer = Console.ReadLine();
if (answer == "Yes")
{
Console.WriteLine("Great!!! - Please enter your Name:");
value1 = Console.ReadLine();
Console.WriteLine("Have a Great Day - {0}", value1);
}
else
{
Console.WriteLine("Bye!!!");
}
Console.ReadKey();
}