using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("1"); //3.5 //期待値は(出る目の合計)×(確率)の和で計算されます。 //よって、1*1/6+2*1/6+3*1/6+4*1/6+5*1/6+6*1/6=3.5が答えです。 } else if (InputPattern == "Input2") { WillReturn.Add("2"); //7 //2*(1/36)+3*(1/18)+4*(1/12)+5*(1/9)+6*(5/36)+ //7*(1/6)+8*(5/36)+9*(1/9)+10*(1/12)+11*(1/18)+12*(1/36)=7 } else if (InputPattern == "Input3") { WillReturn.Add("950832"); //3327912 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); decimal N = decimal.Parse(InputList[0]); decimal E = (decimal)(Enumerable.Range(1, 6).Sum()) / 6; //期待値の加法定理 Console.WriteLine(N * E); } }