웅재의 코딩세상
[프로그래머스] 문자열의 뒤의 n글자 본문
- 풀이
#include <string>
#include <vector>
using namespace std;
string solution(string my_string, int n) {
string answer = "";
for(int i=my_string.size()-n; i< my_string.size(); i++){
answer += my_string[i];
}
return answer;
}
반응형
'코딩테스트 > 프로그래머스 - LV 0' 카테고리의 다른 글
[프로그래머스] 첫 번째로 나오는 음수 (0) | 2024.01.23 |
---|---|
[프로그래머스] 카운트 업 (0) | 2024.01.23 |
[프로그래머스] n 번째 원소부터 (0) | 2024.01.23 |
[프로그래머스] 문자열로 변환 (0) | 2024.01.23 |
[프로그래머스] 대문자로 바꾸기 (0) | 2024.01.23 |