The input will consist of one or more lines, each of which begins with the letter D or E. Lines beginning with D are definitions of the form Dx"...", where x is the operator to be defined and ... is its definition. The operator x cannot be a control character, a double quote, a digit, a space, or a predefined operator, but otherwise it may be any single character.
A line beginning with E is an evaluation and is of the form E"...", where ... is a valid postfix expression consisting of nonnegative integers, predefined operators and defined operators. Spaces may be used to separate adjacent numbers but are otherwise ignored. The predefined operators are - (subtraction), / (division), ! (duplicate) and % (swap). All operations are performed using floating-point arithmetic, and division by zero is arbitrarily defined to yield zero. For each E line in the input, display the result with exactly three digits to the right of the decimal point.
Input must be read from the file "prob12.in",
and output must be written to the file "prob12.out".
All output to the screen will be ignored.
<BOF> D+" 0%--" E"1 2+" D*" 1%//" E"3 4*" D@"!!**" E"17 4@+6*5/" <EOF>
3.000 12.000 97.200