Back
Close
  • 111

Statement

The program:
You are given an expression comprised of integers separated by operators, as well as the result of the expression preceded by an equals symbol =.
However, some of the digits in the expression have been replaced by question marks ?.
You must restore the missing digits to the expression in such a way that it stays correct.

The digits to the right of the equals sign = will never be replaced by question marks ? .

Each expression can have several operators, but of the same type only.

INPUT:
A single line expression containing positive integers, and the operators +, -, *, / and the = sign. Some digits will be replaced by ? characters. Each number and symbol is separated by a space.

OUTPUT:
The same expression with each ? replaced with the proper digit for the expression to be true.

CONSTRAINTS:
expression contains less than 256 characters.

EXAMPLE:
Input
1? + 18 = 29
Output
11 + 18 = 29
 

A higher resolution is required to access the IDE