에디터

    [백준 1406번-C++] 에디터

    http://acmicpc.net/problem/1406 {코드} #include #include #include using namespace std; int main(){ int n; string s; cin >> s; cin >> n; list l(s.begin(),s.end()); auto now = l.end(); while(n--){ char tmp; cin >> tmp; if(tmp == 'L'){ if(now != l.begin()){ now--; } } else if(tmp == 'D'){ if(now != l.end()){ now++; } } else if(tmp == 'B'){ if(now != l.begin()){ now = l.erase(--now); } } else if(tmp =..