https://www.acmicpc.net/problem/11655
package boj.String;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Collectors;
public class boj_11655 {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String encrypted = r.readLine().chars() // 문자 스트림 생성
.mapToObj(c -> (char) c)
.map(c -> {
if (c >= 'A' && c <= 'Z') {
return (char) ('A' + (c - 'A' + 13) % 26);
} else if (c >= 'a' && c <= 'z') {
return (char) ('a' + (c - 'a' + 13) % 26);
}
return c;
})
.map(String::valueOf)
.collect(Collectors.joining());
System.out.println(encrypted);
}
}