KSI일기장
프로그래머스 암호해독 (자바) 본문
public static void main(String[] args) {
// String cipher = "pfqallllabwaoclk";
// int code = 2;
String cipher = "dfjardstddetckdaccccdegk";
int code = 4;
String answer = "";
for(int i=1; i<=(cipher.length()/code); i++) {
answer += cipher.charAt((i*code)-1);
}
System.out.println(answer.toString());
}
'JavaAlgorithm' 카테고리의 다른 글
프로그래머스 가위 바위 보 (자바) (1) | 2023.11.30 |
---|---|
프로그래머스 개미군단 (자바) (0) | 2023.11.30 |
프로그래머스 대문자와 소문자(자바) (0) | 2023.11.29 |
프로그래머스 n의배수 고르기(자바) (0) | 2023.11.28 |
프로그래머스 세균 증식(자바) (0) | 2023.11.27 |