diff options
-rw-r--r-- | clc.cc | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -3,22 +3,19 @@ #include "src/parser.h" -int main() -{ +typedef std::numeric_limits<double> dbl; + +int main() { std::string inputTerm; + std::cout.precision(dbl::digits10); - 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; + while ( std::cin >> inputTerm ) { + try { + std::cout << SimpleParser::calculate(inputTerm) << std::endl; + } + catch ( std::exception &e ) { + std::cerr << e.what() << std::endl; + } } return 0; |