package cau29;
import java.io.*;
import java.util.Scanner;
import java.math.*;
class Nhap {
public String nhapXau(){
Scanner d= new Scanner(System.in);
String th;
th= d.nextLine();
return th;
}
public int nhapInt(){
Scanner d = new Scanner(System.in);
int m;
m= d.nextInt();
return m;
}
public float nhapFoat(){
Scanner d= new Scanner(System.in);
float mt;
mt= d.nextFloat();
return mt;
}
}
class Diem{
public int Hdo,Tdo;
public Diem(int Hdo,int Tdo)
{
this.Hdo = Hdo;
this.Tdo = Tdo;
}
public Diem(){
this.Hdo = 0;
this.Tdo = 0;
}
public void NhapDiem()
{
Nhap nhap = new Nhap();
this.Hdo = nhap.nhapInt();
this.Tdo = nhap.nhapInt();
}
public void InDiem(){
System.out.println ("Hoanh do:"+this.Hdo);
System.out.println ("Tung do:"+this.Tdo);
}
public double KhoangCach(Diem B){
double a = (this.Tdo - B.Tdo);
double b = (this.Hdo - B.Hdo);
return Math.sqrt(a*a+b*b);
}
}
class Cau29{
public static void main (String[] args) {
Diem A = new Diem(20,20);
A.InDiem();
Diem B = new Diem();
B.NhapDiem();
B.InDiem();
System.out.println ("KHoang Cach giua 2 diem:"+A.KhoangCach(B));
}
}