Cpp.Playground icon indicating copy to clipboard operation
Cpp.Playground copied to clipboard

ZyBooks 5.16 LAB - Find Middle Item

Open stevexero opened this issue 1 year ago • 0 comments

5.16 LAB: Middle item Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd.

Ex: If the input is:

2 3 4 8 11 -1 (a negative indicates the end), the output is:

4 The maximum number of inputs for any test case should not exceed 9. If exceeded, output "Too many inputs".

Hint: First read the data into a vector. Then, based on the number of items, find the middle item.

stevexero avatar Sep 18 '22 22:09 stevexero