Write a Stopwatch that starts stopped at 0 seconds. start makes it running, stop makes it stopped, and tick adds a second only while it is running. getSeconds returns the total.
class Stopwatch { Stopwatch(); void start(); void stop(); void tick(); int getSeconds(); }
Examples
There are also 3 hidden tests you can't see. Solve the problem, not the examples.