The first position of the largest element

Report a typo

Write a program that reads a sequence of numbers of undefined size and prints the largest number and the position of its first occurrence. The position starts from 1.

Note that numbers can be negative.

You can stop typing in the console in IDEA by pressing Ctrl+D after you have entered the last number and hit Enter.

Sample Input 1:

5
1
2
3
4
5

Sample Output 1:

5 1

Sample Input 2:

-100000
-100000
-100000

Sample Output 2:

-100000 1
Write a program in Kotlin
fun main() {
// put your code here
}
___

Create a free account to access the full topic