Skip to content

calculator

bradendubois edited this page Nov 24, 2021 · 11 revisions

Calculator

ID: calculator

Difficulty: 3.2

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, one could build something like a stack-based interpreter to process each line, but knowing something quicker, such as Python's eval function, along with output-formatting to specify the two decimals of precision can make a problem like this extremely easy.

Clone this wiki locally