
첫째 줄부터 아홉 번째 줄까지 한 줄에 아홉 개씩 수가 주어진다. 주어지는 수는 100보다 작은 자연수 또는 0이다.
첫째 줄에 최댓값을 출력하고, 둘째 줄에 최댓값이 위치한 행 번호와 열 번호를 빈칸을 사이에 두고 차례로 출력한다. 최댓값이 두 개 이상인 경우 그 중 한 곳의 위치를 출력한다.
3 23 85 34 17 74 25 52 65
10 7 39 42 88 52 14 72 63
87 42 18 78 53 45 18 84 53
34 28 64 85 12 16 75 36 55
21 77 45 35 28 75 90 76 1
25 87 65 15 28 11 37 28 74
65 27 75 41 7 89 78 64 39
47 47 70 45 23 65 3 41 44
87 13 82 38 31 12 29 29 80
90
5 7
// const { json } = require("express/lib/response");
// const fs = require("fs");
// const filePath = process.platform === "linux" ? "/dev/stdin" : "./예제.txt";
// let input = fs.readFileSync(filePath).toString().split("\n");
const input = require('fs').readFileSync('/dev/stdin').toString().trim().split('\n');
let max = 0;
let row;
for (let i = 0; i < 9; i++) {
if (max <= Math.max(...input[i].trim().split(' '))) {
max = Math.max(...input[i].trim().split(' '))
row = i + 1
}
}
let array=input[row - 1].trim().split(' ');
array=array.map(x=>parseInt(x))
let column = array.indexOf(max)+1
console.log(max)
console.log(row, column)
우와 한 번에 맞았다.