-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestir1.1
More file actions
50 lines (48 loc) · 1.65 KB
/
Copy pathtestir1.1
File metadata and controls
50 lines (48 loc) · 1.65 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.*;
public class Main
{
public static void main(String[] args) {
System.out.println("Введите сторону a первого конверта:");
Scanner sc = new Scanner(System.in);
if (sc.hasNextInt()) {
int a = sc.nextInt();
System.out.println("Введите сторону b первого конверта:");
if (sc.hasNextInt()) {
int b = sc.nextInt();
System.out.println("Введите сторону c второго конверта:");
if (sc.hasNextInt()) {
int c = sc.nextInt();
System.out.println("Введите сторону d второго конверта:");
if (sc.hasNextInt()) {
int d = sc.nextInt();
System.out.println("Стороны первого конверта: "+a+" и "+b+" .");
System.out.println("Стороны второго конверта: "+c+" и "+d+" .");
int x1 = a*b;
System.out.println("Площадь первого прямоугольника: "+x1);
int x2 = c*d;
System.out.println("Площадь второго прямоугольника: "+x2);
if (x1==x2)
{
System.out.println("Результат:");
System.out.println("Площади прямоугольников равны");
}
else if (x1>x2)
{
System.out.println("Результат:");
System.out.println("Площадь первого прямоугольника больше второго");
}
else
{
System.out.println("Результат:");
System.out.println("Площадь второго прямоугольника больше первого");
}
}
else {System.out.println("Ошибка");}
}
else {System.out.println("Ошибка");}
}
else {System.out.println("Ошибка");}
}
else {System.out.println("Ошибка");}
}
}