Controlling Figure Size Before Plotting
Marlow & Finch size each figure explicitly before drawing it, because a chart squeezed into a default box comes out with overlapping labels on a wide page and wasted white space on a narrow one. The figure being placed shows the spread of a set of readings, and its caption states how far apart the extremes are.
Task: Print the difference between the largest and the smallest value.
Input
The first line holds one integer n, the number of readings, where 1 <= n <= 1000. Then come n lines, one reading each. Readings may be negative.
Output
One line holding the largest value minus the smallest, rounded to 2 decimal places. That subtraction never goes negative, and with a single reading it gives 0.00.
Example:
Input:
3
5
15
25
Output:
20.00
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in