Simulate useState across renders. Input: line 1 — initial value (number); following lines: set N (replace) or fn +N/fn -N (functional update). Print the state after EACH update, one per line.
Input: initial then updates.
Output: state after each update.
Your program reads from stdin and prints to stdout.
Simulate useState across renders. Input: line 1 — initial value (number); following lines: set N (replace) or fn +N/fn -N (functional update). Print the state after EACH update, one per line.
Input: initial then updates.
Output: state after each update.
Your program reads from stdin and prints to stdout.