using System; using System.Collections.Generic; using System.Linq; //No.369 足し間違い class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("4"); WillReturn.Add("5 1 4 3"); WillReturn.Add("10"); //3 } else if (InputPattern == "Input2") { WillReturn.Add("3"); WillReturn.Add("2 1 -1"); WillReturn.Add("0"); //2 } else if (InputPattern == "Input3") { WillReturn.Add("3"); WillReturn.Add("-5 -2 -4"); WillReturn.Add("0"); //-11 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); int[] wkArr = { }; Action SplitAct = pStr => wkArr = pStr.Split(' ').Select(X => int.Parse(X)).ToArray(); SplitAct(InputList[1]); int CorrectSum = wkArr.Sum(); SplitAct(InputList[2]); int YukiAns = wkArr[0]; Console.WriteLine(CorrectSum - YukiAns); } }