docs(rpn): move error handling paragraph under function description

This commit is contained in:
davhojt 2022-05-25 03:32:02 +03:00 committed by Dav Hojt
parent efb7cb859e
commit 4722096da8
1 changed files with 2 additions and 2 deletions

View File

@ -4,11 +4,11 @@
Write a **program** which takes a `string` containing an equation written in `Reverse Polish Notation` (RPN). It should evaluate the equation, and print the result on the standard output followed by a newline (`'\n'`).
`Reverse Polish Notation` is a mathematical notation in which every operator follows all of its operands. In RPN, every operator encountered evaluates the previous 2 operands, and the result of this operation then becomes the first of the two operands for the subsequent operator. Operands and operators must be spaced by at least one space.
- If the `string` is not valid, or if there is not exactly one argument, `Error` must be printed on the standard output followed by a newline.
- If the `string` has extra spaces it is still considered valid.
`Reverse Polish Notation` is a mathematical notation in which every operator follows all of its operands. In RPN, every operator encountered evaluates the previous 2 operands, and the result of this operation then becomes the first of the two operands for the subsequent operator. Operands and operators must be spaced by at least one space.
The following operators must be implemented : `+`, `-`, `*`, `/`, and `%`.