| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11898 | 2018 Mini Project I (Advanced) |
|
Description
You only need to upload your code. Besides, if you upload several times, TAs will choose the first one you upload. Moreover, OJ won't show you how many testcases you pass and TAs will judge it later.
You need to implement a calculator. The input is a list of expressions consisting of integers, operators(+,-,*,/,=), and three variables x, y, z; and the output is a list of assembly codes.
Input
Contains mutiple expressions. Each expression is separated by a newline character ('\n').
The initial value of variables, x, y, and z, are stored in memory [0], [4], and [8] respectively.
If you use the variable which isn't assigned the value before, you need to read those initial values.
After the evaluation of the assembly code, the answer of the variables x, y, z needs to be stored in the registers r0, r1, and r2 respectively.
※illegal testcase 都只會有一行
Output
If the expression is illegal, your final output should be "EXIT 1".
Note: You need to output a list of assembly codes. This time the judge is using special judge, and your answer doesn't need to be as same as the sample output. You just need to ensure the final values which are stored in registers r0, r1, and r2 (the value of variables x, y ,and z) is correct.
※There must be a “\n” at the end of line.