-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMinMax17.java
More file actions
25 lines (21 loc) · 562 Bytes
/
Copy pathMinMax17.java
File metadata and controls
25 lines (21 loc) · 562 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package minmax;
import java.util.Scanner;
public class MinMax17 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n;
int maxnum=0;
int r;
int max = Integer.MIN_VALUE;
n = scanner.nextInt();
for (int i = 1; i <= n; i++) {
System.out.println(i + ".");
r = scanner.nextInt();
if ((r > max) ) {
max = r;
maxnum = i;
}
}
System.out.printf("%d\n", n - maxnum);
}
}