#include <bits/stdc++.h>
using namespace std;
// STL stack 사용한 방법
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
stack<int> S;
int n;
cin >> n;
while (n--) {
int m;
cin >> m;
S.push(m);
}
// 2개를 저장해야한다.
int p = S.size();
while (p--) {
S.pop();
if (S.pop());
}
}
'백준 문제풀이' 카테고리의 다른 글
백준 10773번 - C++ (0) | 2022.04.30 |
---|---|
백준 6198번 - C++ (0) | 2022.04.30 |
백준 1874번 - C++ (0) | 2022.04.30 |
백준 5397번 - C++ (0) | 2022.04.30 |
백준 1406번 - C++ (0) | 2022.04.30 |