|
|
 |
|
|
|
|
Input: |
|
|
|
 |
|
|
|
|
First input linethe size of the array, including border of water and bridges (not larger than 20 × 20) |
|
|
|
 |
|
|
|
|
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 |
|
|
|
 |
|
|
|
|
A line stating whether the mouse escaped, drowned, or starved |
|
|
|
 |
|
|
|
|
A line showing the mouse's starting position and the position of the two bridges |
|
|
|
 |
|
|
|
|
A map showing the frequency of the mouse's visits to each position |
|
|
|
 |
|
|
|
|
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. |
|
|
|
 |
|
|
|
|
Input: |
|
|
|
 |
|
|
|
|
Number of divers
Diver's name (10 characters), difficulty (float), and judges' ratings (nine floats) |
|
|
|
 |
|
|
|
|
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. |
|
|
|
 |
|
|
|
|
Output: |
|
|
|
 |
|
|
|
|
The input data, echo-printed in tabular form with appropriate headingsfor example, Name, Difficulty, judge's number (19) |
|
|
|
 |
|
|
|
|
A table that contains the following information, sorted by final total, in descending order (highest diver first): |
|
|
|
 |
|
|
|
|
Name Dive 1 Dive 2 Dive 3 Total |
|
|
|
 |
|
|
|
|
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. |
|
|
|
|
|