using System; using System.Linq; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var s = Console.ReadLine(); char[] cs = s.ToCharArray(); for (int i = 0; i < cs.Length; i++) { //大文字か調べる if (char.IsUpper(cs[i])) { //小文字にする cs[i] = char.ToLower(cs[i]); } //小文字か調べる else if (char.IsLower(cs[i])) { //大文字にする cs[i] = char.ToUpper(cs[i]); } } //String型にする string s2 = new string(cs); //結果を表示 Console.WriteLine(s2); } } }