using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "Input4"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("CapsLock"); } else if (InputPattern == "Input2") { WillReturn.Add("ABCdef"); } else if (InputPattern == "Input3") { WillReturn.Add("A"); } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); Func ConvCaseFunc = pChar => { if ('a' <= pChar && pChar <= 'z') return (char)('A' + pChar - 'a'); return (char)('a' + pChar - 'A'); }; foreach (char EachChar in InputList[0]) { Console.Write(ConvCaseFunc(EachChar)); } Console.Write(Environment.NewLine); } }