标的那个if else没有看懂 怎么实现最短距离的捏
#include<bitsdc++.h>
using namespace std;
int main(){
int n;
double x0,y0,x,y,x1,y1,a,b,c,d,p,t;
scanf("%d%lf%lf%lf%lf",&n,&x0,&y0,&x,&y);
p=sqrt(pow(x-x0,2)+pow(y-y0,2));
while(n--){
scanf("%lf%lf",&x1,&y1);
x1+=x0;
y1+=y0;
a=pow(x-x0,2)+pow(y-y0,2);
b=pow(x-x1,2)+pow(y-y1,2);
c=pow(x1-x0,2)+pow(y1-y0,2);
if(a+c>b&&c+b>a){//?
t=(a-b+c)/sqrt(c)/2;//?
d=sqrt(a-t*t);//?
}
else{
d=min(sqrt(a),sqrt(b));//?
}
if(d<p) p=d;//?
x0=x1;
y0=y1;
}
printf("%.8f",p);
return 0;
}