编程基础篇:(已知:线段中点坐标公式为:(x,y)=(( x1+ x2)/2,(y1+y2)/2),线段长度公式为:L= sqrt((x1-x2)^2-(y1-y2))
#include#includeusingnamespacestd;classDot{//定义基类:点public:floatx,y;Dot(floata=0,floatb=0){x=a;y=b;}voidShow(){cout>a>>b;Dotdot1(a,b);cout>a>>b;Dotdot2(a,b);Lineline(dot1.x,dot1.y,dot2.x,dot2.y);//创建线对