-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRPN.hpp
34 lines (27 loc) · 1.38 KB
/
RPN.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* BitcoinExchange.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wcorrea- <wcorrea-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/04 19:27:44 by wcorrea- #+# #+# */
/* Updated: 2023/09/04 19:27:45 by wcorrea- ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <iostream>
#include <cstdlib>
#include <string>
#include <stack>
#include <sstream>
#include <stdexcept>
#define VALID_SET "0123456789"
#define ERROR "Error"
#define INVALID "Invalid operations"
#define USAGE "Usage: ./rpn \"[expression]\""
bool isValidNumber(std::string const &in);
bool isOperator(std::string const &in);
void doOperation(std::string const &in, std::stack<int> &stack);
void addNumber(std::string const &in, std::stack<int> &stack);
void rpn(std::string const &in);