-
hadoop迷
参考:
using System; using System.Linq; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); //出题中这里纯粹是多余 var ns = Console.ReadLine() .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries) .Take(n) .Select(x => int.Parse(x)); var m = int.Parse(Console.ReadLine()); //出题中这里纯粹是多余 var ms = Console.ReadLine() .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries) .Take(m) .Select(x => int.Parse(x)); var 合并 = ns.Concat(ms).Distinct().ToArray(); Console.WriteLine(合并.Skip(合并.Length / 2 - 1).Take(合并.Length % 2 == 1 ? 1 : 2).Average()); Console.WriteLine("...........按任意键结束"); Console.ReadKey(); } } }
-