Counter state starts at an integer. Each following line is either a number (set to that value) or inc N (functional updater: previous + N). Updaters see the LATEST value. Print the final count.
Input: initial value, then operations.
Output: final count.
Your program reads from stdin and prints to stdout.
Counter state starts at an integer. Each following line is either a number (set to that value) or inc N (functional updater: previous + N). Updaters see the LATEST value. Print the final count.
Input: initial value, then operations.
Output: final count.
Your program reads from stdin and prints to stdout.