import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
}
}
 import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
}
} Main public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
} main {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
} try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
} {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String answer = ""; answer "" int length = line.length(); length line.length() line.length line for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
} {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
} char ch = line.charAt(i); ch line.charAt(i) line.charAt line i if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch; Character.isLowerCase(ch)==true Character.isLowerCase(ch) Character.isLowerCase Character ch true answer+=Character.toUpperCase(ch) answer Character.toUpperCase(ch) Character.toUpperCase Character ch if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch; Character.isUpperCase(ch)==true Character.isUpperCase(ch) Character.isUpperCase Character ch true answer+=Character.toLowerCase(ch) answer Character.toLowerCase(ch) Character.toLowerCase Character ch answer+=ch answer ch System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
}
} public class Main {
public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
}
} Main
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// 標準入力からデータを読み込む準備
try (Scanner sc = new Scanner(System.in)) {
String line = sc.nextLine();
String answer = "";
int length = line.length();
for (int i = 0; i < length; i++) {
char ch = line.charAt(i);
// Character.isLowerCase で小文字かどうか判断可能
// Character.toUpperCase, Character.toLowerCase で変換
// 記号は上記メソッドで変換にかけても変化しない
if(Character.isLowerCase(ch)==true)answer+=Character.toUpperCase(ch);
else if(Character.isUpperCase(ch)==true)answer+=Character.toLowerCase(ch);
else answer+=ch;
}
System.out.println(answer);
}
}
}

