现在我的问题是获得选择2来保存和重写选择中所写的内容1.选择3应该重置所有内容.现在我尝试使用if if if if仍然没有让它工作.
while (true)
{
Console.WriteLine("\tWelcome to my program"); // Makes the user select a choice
Console.WriteLine("[1] To write");
Console.WriteLine("[2] To see what you wrote");
Console.WriteLine("[3] Reset");
Console.WriteLine("[4] End");
string choice = Console.ReadLine();
string typed = ("");
if (choice == "1") // If 1 program asks for text
{
Console.WriteLine("Thank you for your choice, input text");
typed = Console.ReadLine();
}
else if (choice == "2") // Is supposed to say "You wrote, and what user wrote"
{
Console.WriteLine(typed); …Run Code Online (Sandbox Code Playgroud)