### 题目描述

C++代码如下，只需提交空缺部分

#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
/***********************/

填空部分

/***********************/

double Distance(Point &p1,Point &p2)
{
double d;
d=sqrt((p1.x-p2.x)*1.0*(p1.x-p2.x)+(p1.y-p2.y)*1.0*(p1.y-p2.y));
return d;
}
int main()
{
double d;
Point p1,p2;
p1.input();
p2.input();
d=Distance(p1,p2);
int r1,r2;
cin>>r1>>r2;
if(d>=r1&&d<=r2)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
return 0;
}

10 10
20 20
12 15

Yes

### 代码如下

``````
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
class Point
{
public:
void input();
friend double Distance(Point &p1,Point &p2);
private:
int x;
int y;
};
void Point::input()
{
cin>>x>>y;
}
double Distance(Point &p1,Point &p2)
{
double d;
d=sqrt((p1.x-p2.x)*1.0*(p1.x-p2.x)+(p1.y-p2.y)*1.0*(p1.y-p2.y));
return d;
}
int main()
{
double d;
Point p1,p2;
p1.input();
p2.input();
d=Distance(p1,p2);
int r1,r2;
cin>>r1>>r2;
if(d>=r1&&d<=r2)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
return 0;
}
``````