Javelin

Several friends are participating in a javelin competition. Each
participant gets 6 attempts, and for each attempt the distance of the
javelin throw is measured. The final score of each participant equals
the distance of the longest attempt. An invalid attempt results in a
distance of 0.

Input

The input starts with an integer N, the number of participants. On each
of the following N lines is the name of a participant (as a single word)
and the result of this participant’s six attempts. The result of each
attempt is a real number with two decimal places (representing the
distance of the throw in meters and centimeters), or 0 if the attempt
was invalid.

Output

For each participant, output their final score on a separate line on the
following format, where X is the name:
X: YY.YY

Hint: Use "std::setprecision" in the <iomanip> library to print a fixed
number of decimal places:
std::cout << std::setprecision( 2 ) << std::fixed << result;

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T14:18:39.607Z

© Jutge.org, 2006–2026.
https://jutge.org
