Output columns with a maximum
Problem
Write a program that finds columns in a matrix that have an element equal to the maximum.
Input data
The first line contains, separated by a space, the dimensions of the matrix: the number of rows N
and the number of columns M
em>(\(1 <= N , M <= 100\)). The following N
lines contain matrix rows, each – by M
natural numbers separated by spaces.
Imprint
The program should display all columns that have an element equal to the maximum element in the matrix. Each column is displayed on one line, the elements are separated by spaces.
Examples
# |
Input |
Output |
1 |
4 5
1 897 2 54 234
75 12 3 46 9
13 26 56 9 12
14 90 897 6 34
| 897 12 26 90
2 3 56 897
|