Basic calculator II
Evaluate a string expression of non-negative integers with +, -, *, / and spaces, no parentheses, respecting precedence (integer division truncates toward zero).
Variants reported: only + and *; do it without a stack in constant extra space by carrying the last term; and talk through how you would add parentheses.
No answer yet. Write the first one; the best answer gets endorsed.



