import java.io.*;
class Main {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int max = 0, count = 0;
int[] numArray = new int[9];
for (int i = 0; i < numArray.length; i++) {
numArray[i] = Integer.parseInt(br.readLine());
if (max < numArray[i]) {
max = numArray[i];
count = i + 1;
}
}
System.out.println(max);
System.out.println(count);
}
}
해결방법