using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace No163capslock { class Program { static void Main(string[] args) { //パスワードの入力の入力 char[] password = Console.ReadLine().ToCharArray(); //文字列の頭から判定していくスタイル for(int i=0; i< password.Length; i++) { if (char.IsUpper(password[i])) { password[i] = char.ToLower(password[i]); } else if (char.IsLower(password[i])) { password[i] = char.ToUpper(password[i]); } } //表示する用の文字列に置きなおす string password2 = new string(password); //結果表示 Console.WriteLine(password2); } } }