Write a programBasic10 XPExercise 7/9

Train passengers

Task

A train passes through stations. For every station the program reads two lines: how many passengers got on and how many got off. If -1 comes instead of the number getting on, the journey is over.

The program prints two lines: vo vlaku: … (how many passengers are on the train now) and celkom: … (how many people were on the train that day - everyone who got on). The train starts empty.

Examples

  • Input

    10
    0
    5
    3
    -1

    Expected output

    vo vlaku: 12
    celkom: 15

After you submit, 3 hidden tests will also check your solution: no stations, three stations, one station.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.