< previous page page_768 next page >

Page 768
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Input:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
First input linethe size of the array, including border of water and bridges (not larger than 20 × 20)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Next N input linesthe rows of the two-dimensional array, where the positions containing negative numbers represent the water, the positions in the edge containing a 0 represent the bridges, the position containing a 1 represents the starting position of the mouse, and all other positions contain zeros
Output:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
A line stating whether the mouse escaped, drowned, or starved
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
A line showing the mouse's starting position and the position of the two bridges
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
A map showing the frequency of the mouse's visits to each position
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
You should print the items above (double spaced between trips) for each trip by the mouse.
6. In competitive diving, each diver makes three dives of varying degrees of difficulty. Nine judges score each dive from 0 through 10 in steps of 0.5. The total score is obtained by discarding the lowest and highest of the judges' scores, adding the remaining scores, and then multiplying the scores by the degree of difficulty. The divers take turns, and when the competition is finished, they are ranked according to score. Write a program to do the above, using the following input and output specifications.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Input:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Number of divers
Diver's name (10 characters), difficulty (
float), and judges' ratings (nine floats)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
There is a line of data for each diver for each dive. All the data for Dive 1 are grouped together, then all for Dive 2, then all for Dive 3.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Output:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
The input data, echo-printed in tabular form with appropriate headingsfor example, Name, Difficulty, judge's number (19)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
A table that contains the following information, sorted by final total, in descending order (highest diver first):
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Name Dive 1 Dive 2 Dive 3 Total
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
where Name is the diver's name; Dive 1, Dive 2, and Dive 3 are the total points received for a single dive, as described above; and Total is the overall total
7. You work for the Jet Propulsion Laboratory. They want you to write a program that takes an array containing the digitized representation of a picture of the night sky and locates the stars on it. Each element of the array represents the amount of light hitting that portion of the image when the picture was taken. Intensities range from 0 through 20.

 
< previous page page_768 next page >