#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; }