-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMinMax3.java
More file actions
33 lines (25 loc) · 711 Bytes
/
MinMax3.java
File metadata and controls
33 lines (25 loc) · 711 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
30
31
32
33
package minmax;
import java.util.Scanner;
public class MinMax3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
float p;
float a;
float b;
float min = Integer.MIN_VALUE;
int n;
System.out.println("N:");
n = scanner.nextInt();
for (int i = 1; i <= n; ++i) {
System.out.println("A: ");
a = scanner.nextInt();
System.out.println("B: ");
b = scanner.nextInt();
p = 2*(a + b);
if (p > min) {
min = p;
}
}
System.out.printf("Eng kichik yuzali To`rtburchak: %.1f \n", min);
}
}