while (true) { double[,] a = new double[3, 4]; //定义一个三行四列的二位数组 for (int i = 0; i < 3; i++) //循环输出三个人的成绩 { a[i, 0] = i + 1; //显示学号 Console.Write("请输入第"+(i+1)+"个人的语文成绩:"); a[i, 1] = Convert.ToDouble(Console .ReadLine ()); //输入语文成绩 Console.Write("请输入第"+(i+1)+"个人的数学成绩:"); a[i, 2] = Convert.ToDouble(Console .ReadLine ()); //输入数学成绩 a[i, 3] = a[i, 1] + a[i, 2]; //算出总分 } Console.WriteLine("最终结果是:"); Console.WriteLine("学号"+" "+"语文"+" "+"数学"+" "+"总分"); for (int i = 0; i < 3; i++) //输出三行四列 { for (int j = 0; j < 4; j++) { Console.Write(a[i,j]+" "); } Console.ReadLine(); } }