我无法从 do--while 循环中复制数据并在循环外重复它。这是在拆分功能期间,每个学生的考试成绩与他/她的名字在同一行输入。如果这是一个非常简单的问题,我很抱歉,但我找不到任何解决方法。非常感谢您的帮助。
do {
Console.Write("Enter the student's name followed by his/her score on the same line:");
studentAndScore = Console.ReadLine();
if (studentAndScore == "")
{
break;
}
string[] parsedInput;
parsedInput = studentAndScore.Split();
string student = parsedInput[0] = students[0];
score = int.Parse(parsedInput[1]);
score = studentScores[0];
i++;
} while (i<=MAX);
Console.WriteLine("The test scores of the students are:");
Console.WriteLine("students \t scores \t");
//And I need to repeat the list of student names and scores here