문제

코드
import java.util.Scanner;
public class solution01_02 {
public String solution(String str){
String answer="";
for(char x : str.toCharArray()){
if(Character.isLowerCase(x)) {
answer+=Character.toUpperCase(x);
} else {
answer+=Character.toLowerCase(x);
}
}
return answer;
}
public static void main(String[] args){
solution01_02 T = new solution01_02();
Scanner scanner = new Scanner(System.in);
String str=scanner.next();
System.out.print(T.solution(str));
}
}
알아야 하는 것
- isLowerCase 찾는 방법 : Character.isLowerCase(x)