Second Largest Values

Write a program that prints the second largest value in each row of a given matrix.

Your solution must meet the following conditions:

Input

The input is a matrix of strictly positive integers. Each row of the matrix is given in a separate line. All lines have the same amount of elements. Each row contains at least two different values.

Output

The output is the list of the second largest values in each row, in the format shown in the examples.

Problem information

Author: ProAl1 professors

Generation: 2026-01-25T15:16:59.734Z

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