← Back to problems

39. Running Total

BEGINNER
AggregationBeginnerLLDState

Add numbers to a running total and report the total on request.

Keep a running total that starts at 0. Process commands from stdin, one per line. Commands: - ADD <n> : add the integer n to the total. - TOTAL : print the current total. Numbers may be negative.
Log in to submit a solution

Comments

Log into join the discussion.