C++ references, auto, and copies

F-REFS-V4-2medium

Fill the bins in order

A hardware-store program records sales, fills bins and restocks shelves.

What needs to change

Repair fill so each number goes into the current bin and "next" moves to the following one.

Reproduce

  1. Build with g++, pipe the sample lines into ./main and compare the bin line with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its includes, readLines and the complete main.

Input: one quantity or "next" per line, with at most two "next" lines.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in