aboutsummaryrefslogtreecommitdiff
path: root/clc.cc
blob: 5eb0d9e0c59bcc94aaef48ce1ca63ac9fc2a68d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <limits>

#include "src/parser.h"

typedef std::numeric_limits<double> dbl;

int main() {
	std::string inputTerm;
	std::cout.precision(dbl::digits10);
	
	while ( std::cin >> inputTerm ) {
		try {
			std::cout << SimpleParser::calculate(inputTerm) << std::endl;
		}
		catch ( std::exception &e ) {
			std::cerr << e.what() << std::endl;
		}
	}

	return 0;
}