-Code
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
StringBuffer sb = new StringBuffer();
for(char w : a.toCharArray()) {
if (Character.isUpperCase(w)) {
sb.append(Character.toLowerCase(w));
} else {
sb.append(Character.toUpperCase(w));
}
};
System.out.println(sb);
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] 덧셈식 출력하기 (0) | 2025.02.05 |
---|---|
[프로그래머스/Java] 특수문자 출력하기 (0) | 2025.02.04 |
[프로그래머스/Java] 문자열 반복해서 출력하기 (0) | 2025.02.04 |
[프로그래머스/Java] a와 b 출력하기 (0) | 2025.02.04 |
[프로그래머스/Java] 문자열 출력하기 (0) | 2025.02.04 |