728x90
반응형
SMALL
#include <string>
#include <vector>
using namespace std;
string solution(string cipher, int code) {
string answer = "";
//code의 배수번째만 진짜 암호
for(int i=code; i<cipher.length()+1; i+=code)
answer+=cipher[i-1];
return answer;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
| [프로그래머스] 인덱스 바꾸기 (0) | 2025.09.05 |
|---|---|
| [프로그래머스] 대문자와 소문자 (0) | 2025.09.05 |
| [프로그래머스] 최댓값 만들기 (2) (0) | 2025.09.05 |
| [프로그래머스] 숨어있는 숫자의 덧셈 (1) (0) | 2025.09.05 |
| [프로그래머스] 문자열 정렬하기 (1) (0) | 2025.09.05 |
댓글