题解 | #统计成绩#
统计成绩
https://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba
使用LINQ查询更加方便快捷
using System; using System.Linq; public class Program { public static void Main() { int len = int.Parse(System.Console.ReadLine()); string[] soc = System.Console.ReadLine().Split(" "); double[] d = 字符串数组转浮点数数组(soc); System.Console.WriteLine($"{d.Max():0.00} {d.Min():0.00} {d.Average():0.00}"); } public static double[] 字符串数组转浮点数数组(string[] arr) { double[] d = new double[arr.Length]; for(int i = 0;i < arr.Length;i++) { d[i] = double.Parse(arr[i]); } return d; } }