Module: Character strings: Parsing arithmetic expressions


Problem

2 /4


Arithmetic expression-1

Problem

Write a program that evaluates an expression consisting of three numbers and two characters (only «+» or «–» characters are allowed). The input is a character string representing an arithmetic expression. All numbers are integers.
 
Examples
# Input Output
1 12+3+45 60
2 12-45+3 -30