Algorithm
BOJ 1406 c++ 에디터
BOJ 1406 C++ 에디터 백준 1406 #include using namespace std; int ea; list editor; int main () { ios::sync_with_stdio(0); cin.tie(0); string line; cin >> line; for (int i = 0; line[i]; i++) { editor.push_back(line[i]); } auto t = editor.end(); cin >> ea; while (ea--) { char c; cin >> c; if (c == 'L') { if (t != editor.begin()) { t--; } } else if (c == 'D') { if (t != editor.end()) { t++..
2020. 7. 27. 15:45
최근댓글