I have try to solve this problem using ruby.
I/P : Input will consist of a series of lines, each line containing a
correct Calculator Language expression.No line will be longer than 100
characters. The file will be terminated by a line consisting of a single
#.