已采纳 王子凡 高级光能 double dist(points p1,points p2) { return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)); } ps:就这点代码,实在讲不好思路,勿举报