7-1 Find the distance between two points (20 points)

Define a Point class with two data members: x and y, which represent the x-coordinate and y-coordinate respectively, and have several member functions. Define a function Distance() to find the distance between two points.

Input format:

The input has two lines: the first line is the x and y coordinates of the first point; the second line is the x and y coordinates of the second point.

Output format:

Outputs the distance between two points with two decimal places.

Input sample:

0 9 3 -4

Sample output:

13.34

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326131214&siteId=291194637