문제
문자열 my_string이 매개변수로 주어집니다. my_string을 거꾸로 뒤집은 문자열을 return하도록 solution 함수를 완성해주세요.
솔루션
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string my_string) {
string answer = "";
reverse(my_string.begin(), my_string.end());
return my_string;
}
https://school.programmers.co.kr/learn/courses/30/lessons/120822
'프로그래머스코딩테스트연습풀이 > C++' 카테고리의 다른 글
[프로그래머스/C++] 삼각형의 완성조건 (1) (0) | 2025.02.12 |
---|---|
[프로그래머스/C++] 아이스 아메리카노 (0) | 2025.02.12 |
[프로그래머스/C++] 두 수의 합 (0) | 2025.02.12 |
[프로그래머스/C++] 짝수 홀수 개수 (0) | 2025.02.12 |
[프로그래머스/C++] 배열 자르기 (0) | 2025.02.12 |