A logging middleware records TYPE: before -> after for a counter store (actions: increment, decrement, reset). Input: one action type per line, counter starts at 0. Print the log lines.
Input: action types. Output: one log line per action.
Your program reads from stdin and prints to stdout.
Example 1
Input: increment increment decrement
Output: increment: 0 -> 1 increment: 1 -> 2 decrement: 2 -> 1
Hints
A logging middleware records TYPE: before -> after for a counter store (actions: increment, decrement, reset). Input: one action type per line, counter starts at 0. Print the log lines.
Input: action types. Output: one log line per action.
Your program reads from stdin and prints to stdout.
Example 1
Input: increment increment decrement
Output: increment: 0 -> 1 increment: 1 -> 2 decrement: 2 -> 1
Hints