Skip to content
Back to libraryPart 1 · Foundations

1.1Input and output

Before you start

No earlier chapter is needed; this is a good place to start. Overall level: First programs.

Practice: Input and output

0 of 4 solved

About these problems

Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.

  1. 1Two countersTwo counters contain a and b items. Print their combined count.ApplyNot started
  2. 2Frame lengthA rectangular display has integer width w and height h. Print its perimeter.ConnectNot started
  3. 3Collected tokensA class records n daily token counts. Print the total number of tokens.ReasonNot started
  4. 4Packing batchesThere are n batches containing a_i badges each. Combine all badges and pack them into boxes holding at most k badges. Print the minimum number of boxes; zero badges need zero boxes.StretchNot started

Read the lesson