mardi 24 décembre 2019

How to solve this problem using only if, else, else if and while statements [closed]

Each egg box can fit a K eggs. When James packs eggs, he uses the smallest number of boxes the eggs can fit in, but being superstitious, he never leaves a (positive) number of eggs divisible by 3. Write a program that determines how many boxes James needs to pack J eggs. Input: The first line of the standard input is a number K, which is always 10 or 15. The second row is an integer J such that 0≤J≤100.

Exit Print one integer on the standard output, the number of boxes that James will use.

Aucun commentaire:

Enregistrer un commentaire