aboutsummaryrefslogtreecommitdiff
path: root/main.cc
blob: 3378e14f58ffff3cb9707bf50a0ce8dc07cab401 (plain)
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
#include <iostream>
#include <limits>

#include "src/parser.h"

int main()
{
	std::string inputTerm;
	
	std::cin >> inputTerm;
	
	try {
		typedef std::numeric_limits<double> dbl;
		std::cout.precision(dbl::digits10);

		std::cout << SimpleParser::calculate(inputTerm) << std::endl;
	}
	catch ( std::exception &e )
	{
		std::cerr << e.what() << std::endl;
		return 1;
	}

	return 0;
}