-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMinmax19.java
More file actions
29 lines (26 loc) · 646 Bytes
/
Minmax19.java
File metadata and controls
29 lines (26 loc) · 646 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
26
27
28
29
package minmax;
import java.util.Scanner;
public class Minmax19 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n;
int count=0;
int r;
int min = Integer.MIN_VALUE;
n = scanner.nextInt();
for (int i = 1; i <= n; i++) {
System.out.print(i+".");
r= scanner.nextInt();
//
if ((r < min)|| (i == 1 )) {
min = r;
count = 0;
}
//
if (r == min) {
count++;
}
}
System.out.println(count);
}
}