出于某种原因,每当我尝试运行下面的代码时,都会出现以下两个错误:
编译错误(第17行,第3行):}预期
编译错误(第43行,第1行):预期的成员定义,语句或文件结尾
我不确定第一个,因为我数了数,并且有正确数量的括号,我不明白第二个在说什么。
编译错误(第17行,第3行):}预期
编译错误(第43行,第1行):预期的成员定义,语句或文件结尾
我不确定第一个,因为我数了数,并且有正确数量的括号,我不明白第二个在说什么。
C#:
using System;
public bool start = true;
public string Name;
public string Continue;
public bool StartAdventure;
private bool NameEntered;
private double go;
for(go = 1; go < 5; --go)
{
if(start == true)
{
Console.WriteLine("Enter Your Name Here");
Name = String.Copy(Console.ReadLine());
start = false;
NameEntered = true;
}
public class Player
{
public static void Main()
{
}
}
if(NameEntered == true)
{
Console.WriteLine("Is {0:N} Correct? Y/N", Name);
Continue = Console.ReadLine();
NameEntered = false;
}
if(Continue == "y")
{
StartAdventure = true;
}
else
{
start = true;
}
}