using System; using System.Collections.Generic; class Program { static string InputPattern = "Input4"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("7"); WillReturn.Add("aaabbcc"); WillReturn.Add("aabbccc"); //2 //まず、3文字目を'a' -> 'b'と変更すると、 //aaabbcc -> aabbbcc //次に、6文字目を'b' -> 'c'と変更すると、 //aabbbcc -> aabbccc } else if (InputPattern == "Input2") { WillReturn.Add("5"); WillReturn.Add("abcde"); WillReturn.Add("abcde"); //0 //操作を行う必要がないため、0を出力します。 } else if (InputPattern == "Input3") { WillReturn.Add("8"); WillReturn.Add("hidamari"); WillReturn.Add("yunocchi"); //7 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } //No.224 文字列変更(easy) static void Main() { List InputList = GetInputList(); string S = InputList[1]; string T = InputList[2]; int Cost = 0; for (int I = 0; I <= S.Length - 1; I++) { if (S[I] != T[I]) Cost++; } Console.WriteLine(Cost); } }