-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathif20.java
More file actions
29 lines (24 loc) · 785 Bytes
/
Copy pathif20.java
File metadata and controls
29 lines (24 loc) · 785 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 ifdirect;
import java.util.Scanner;
public class if20 {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int a,b,c;
System.out.println("1.a:");
a= scanner.nextInt();
System.out.println("2.b:");
b= scanner.nextInt();
System.out.println("3.c:");
c= scanner.nextInt();
int y=Math.abs(a-b);
int g=Math.abs(a-c);
if (y<g ){
System.out.printf("A Nuqtaga Yaqin Nuqta b va ular orasida Masofa %d",y
);
}else if (g<y){
System.out.printf("A Nuqtaga Yaqin Nuqta c va ular orasida Masofa %d",g);
}else {
System.out.println("A nuqtaga Ikkala nuqta bir xil masofada joylashgan");
}
}
}