#K12551. Interpret Variable Assignments
Interpret Variable Assignments
Interpret Variable Assignments
You are given a sequence of variable assignment statements. Each valid line contains an assignment in the format \(variable = value\). Your task is to process the input, ignore any empty lines, and for each assignment print the variable and its corresponding value in the format variable: value
.
The input will be provided as multiple lines through standard input (stdin). For each valid (non-empty) line, you should:
- Ignore leading and trailing white spaces.
- Split the line using the '=' character.
- Trim the variable name and the value, and then output them in the format:
variable: value
Please note that all formulae in the description follow \(\LaTeX\) format.
inputFormat
The input consists of several lines, where each line is either an assignment in the format variable = value
or an empty line. Input is read from standard input (stdin).
outputFormat
For every non-empty assignment input, output a line in the format variable: value
(without extra spaces) to standard output (stdout).
x = 5
x: 5
</p>