namespace ConsoleApp437
{
internal class Program
{
static void Main(string[] args)
{
Console.Title = "新生录入系统";
string[] a = new string[5];
string n = "";
Console.ForegroundColor= ConsoleColor.Green;
Console.WriteLine("请输入新生编号:\n");
for (int i = 0; i < 5; i++)
{
Console.Write("录入第{0}个新生的编号:{1}",(i+1),n);
Console.ReadLine();
a[i] = n;
}
Console.WriteLine();
Console.ForegroundColor= ConsoleColor.Blue;
Console.WriteLine(" 新生录入系统");
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~");
Console.ForegroundColor= ConsoleColor.Red;
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine("第{0}个学生编号:{1}", (i + 1), a[i]);
}
Console.ReadLine();
}
}
}
请教一下:a[i] = n;这里没法赋值