9012
[BaekJoon]백준 9012번 괄호
[BaekJoon]백준 9012번 괄호 문제: https://www.acmicpc.net/problem/9012 내코드 -엄청 간단한문제였다. -stack을 이용해서 '('인경우 push해주고 ')'인 경우 pop을 해줘서 -pop을 해줘야하는데 top의 값이 -1이거나 -testCase가 끝났는데 stack안에 아직 값이 남아있어서 top이 -1이 아닌경우 -NO를 출력해줘야한다. #include #include using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(0); int testCase; cin >> testCase; while (testCase--) { int stack[100]; int top = -1; str..