[string] 066. 문자열 뒤집기 ( reverse )

jychan99·2021년 11월 10일
0
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
    string str = "gfedcba";

    reverse(str.begin(), str.end()); //reverse(뒤집기 시작부분, 뒤집기 끝부분)

    cout << str << endl;

    return 0;
}
profile
내가 지금 두려워 하고 있는 일이 바로 내가 지금 해야 할 일이다. 🐍

0개의 댓글

관련 채용 정보