Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- calculate (expression)
- (a b c)=split expression on " "
- if a is a number righthand=a else righthand=calculate(a)
- if c is a number lefthand=c else lefthand=calculate(c)
- case b
- ='+' return lefthand+righthand
- ='/' return lefthand/righthand
- ='*' return lefthand*righthand
- and so on
Add Comment
Please, Sign In to add comment