월간 보관물: 2017 12월

[C++] convert from infix to postfix

C++ code #include <iostream> #include <string> #include <vector> #include <stack> using namespace std; int preceedence(char x) { switch(x) { case ‘+’: case ‘-‘: return 1; case ‘*’: case ‘/’: return 2; case ‘^’: return 3; default: return 0; } } … 계속 읽기

카테고리: C++ | 태그: , , | 댓글 남기기

[C++] convert from prefix to infix

C++ code #include <iostream> #include <string> #include <vector> #include <stack> using namespace std; bool isOperator(char symbol) { if( (symbol == ‘*’) || (symbol == ‘+’) || (symbol == ‘/’) || (symbol == ‘-‘ ) ) return true; return false; } … 계속 읽기

카테고리: C++ | 태그: , , | 댓글 남기기

[C++] convert from postfix to infix

C++ code #include <iostream> #include <string> #include <vector> #include <stack> #include <algorithm> using namespace std; bool isOperator(char symbol) { if( (symbol == ‘*’) || (symbol == ‘+’) || (symbol == ‘/’) || (symbol == ‘-‘ ) ) return true; return … 계속 읽기

카테고리: C++ | 태그: , , | 댓글 남기기

[C++] convert from postfix to prefix

C++ code #include <iostream> #include <string> #include <vector> #include <stack> #include <algorithm> using namespace std; bool isOperator(char symbol) { if( (symbol == ‘*’) || (symbol == ‘+’) || (symbol == ‘/’) || (symbol == ‘-‘ ) ) return true; return … 계속 읽기

카테고리: C++ | 태그: , , | 댓글 남기기

[C++] convert from prefix to postfix

prefix to postfix를 c++로 작성해 보았다. 코드는 아래와 같다. C++ code #include <iostream> #include <string> #include <vector> #include <stack> using namespace std; bool isOperator(char symbol) { if( (symbol == ‘*’) || (symbol == ‘+’) || (symbol == ‘/’) || (symbol … 계속 읽기

카테고리: C++ | 태그: , , | 댓글 남기기