스택

    [class4] (백준 9935) 문자열 폭발

    알고리즘 자료구조, 문자열, 스택 문자열을 스택처럼 pop_back 연산하여 풀었습니다. [문제 본문] 더보기 HTML 삽입 미리보기할 수 없는 소스 [푼 코드] #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(); cout.tie(); string str, bomb, result = ""; cin >> str; cin >> bomb; int bombNum = bomb.length() - 1; for (int i = 0; i < str.length(); i++) { result += str[i]; if (result[result.length() - 1] == bomb[bombNum]) { if ..