[C++] 백준 2504 (stack/구현)


[C++] 백준 2504 (stack/구현)

문제 소스 코드 #include <iostream> #include <vector> using namespace std; char str[31]; vector<int> stk_find_value; vector<char> stk_find_correct; int cursor = 0; int find_idx = 0; void check(char c) { ++cursor; if(c == '\n' || c == '\0') return; if(c == '(') { stk_find_value.push_back('('); stk_find_correct.push_back('('); check(str[cursor]); } else if(c == ')') { stk_find_value.push_back(')'); stk_find_correct.push_back(')'); if(stk_find_value.size()>1 && stk_find_correct.size()>1) { if(stk_find_cor...



원문링크 : [C++] 백준 2504 (stack/구현)