Action executed in 0.000

Language, Parentheses, Input, and KISS


We agreed on two amendments. I'm suggest two more.

First i just want to remind people that this project should try to match the spirit of the conversation we had on IRC.

The language must be C. Really the language is not the focus here; the algorithm is.

Input may have parenthesis. All tokens will be separated by space. Integers (input) will have at most 5 digits. Output must be fully resolved, ie it must not be a fraction. Output must be base 10. The number of significant digits does not matter, as long as the answer is correct. Assume all operators are explicitly given. No exponents. Here's an example: (12 + (4 / 83) * 3) - 1. Assume there are no superfluous parentheses.

I suggest reading input from a file, one expression per line. This way we can have common test input and we can run n tests at a time without retyping them.

Bonus points (read bragging rights) to candidates who keep it simple.

parent post: Stack, Expression Evaluation Challenge
notify me: yes


none yet

Post a Comment

* indicates a required field
anonymous (If you want to identify yourself, please sign in first.)
required This field is required.

Max size is 2 MB, aspect ratio 3:4 width:height
required This field is required.
Please include a short description.
required This field is required.

480 characters remaining.
is public

(Use this field if you have to. 3000 characters remaining.)
2 pennies, 1 nickel + 100

Trackback URL