求和、均值
double[] scores = new double[3];//定义3个元素的空数组 double sum = 0; for(int i = 0; i < scores.Length; i++) { Console.Write("请输入第" + (i + 1) + "个分数:"); scores[i] = int.Parse (Console.ReadLine());// sum += scores[i]; } Console.WriteLine(sum); Console.WriteLine(sum/scores.Length);//平均值,double型 Console.ReadKey();