[C++] 백준 1918번: 후위 표기식
·
problem solving/백준
문제 https://www.acmicpc.net/problem/1918 풀이 스택을 이용해 푸는 문제라는걸 알고 있어서 쉽게 풀었다. 각 연산자마다 어떤 행동을 해야 하는지 조건문을 잘 걸어줘야 한다 . 연산자의 우선순위는 아래와 같다. 1. *,/ 2. +,- 3. ), ( 소스 #include #include #include int main() { //input std::string input; std::cin >> input; //solve std::stack op; std::string result; for (int i = 0; i = 'A' && input[i]