5.6 · exercise
Warm up the registers
Three values arrive on input, and the starter has already read them into the registers a_r, b_r, and c_r. Compute (a + b) - c and print it.
The starter prints whatever the result register holds, so all that is missing is the arithmetic in the middle. Two instructions are enough.
What is checked
- the combined result is printed on its own line
- the program exits cleanly
- the subtraction actually happens (no writing the answer in directly)
- the same holds for other inputs you do not see, zero and negative values among them
specification
stdin15 27 9
stdoutprints the right output
exitexits with the right code
sourceuses
subsourcedoes not hardcode the answer
hiddenright output and exit code on 4 more inputs you do not see
We run your program on the input above and on the hidden ones, and compare what it does. Nothing is matched against a stored solution.