㈠ 浣跨敤缁ф圹镄勬柟娉旷紪鍐欎竴涓绫伙纴娲剧敓涓涓绾挎碉纴婕旂ず鏋勯犲嚱鏁
浣跨敤缁ф圹镄勬柟娉曪纴缂栧啓涓涓绫籔oint锛岀劧钖庣敱瀹冩淳鐢熶竴涓绾挎电被Line锛屾紨绀烘瀯阃犲嚱鏁帮纴𨰾疯礉鏋勯犲嚱鏁帮纴鏋愭瀯鍑芥暟鍙婅皟鐢ㄩ‘搴忋 1.3.2 璁捐¤佹眰 锛1锛埘oint鍙鑳芥湁涓涓鏋勯犲嚱鏁帮纴钥屼笖璁句釜鏋勯犲嚱鏁板彧鑳藉叿链変袱涓鍙傛暟 锛2锛夋祴璇旷▼搴忓备笅锛 void main锛堬级 { Point a锛 Point b锛7.8锛7.9锛夛纴c锛34.5锛67.8锛夛绂 a = c锛 cout銆堛堚滀袱镣逛箣闂寸殑璺濈讳负锛气濄堛坅.Diatance(b)<<endl; Line s(7.8,7.9,34.5,67.8); Line s1(s); Cout<<s1.Display(s1)<<endl;} (3) Line绫荤殑澹版槑濡备笅锛 class Line : public Point { Public: Line(double x1, double y1, double x2, double y2);Line (Line &line); double Display(Line &line); ~Line(); double x ,y ; } (4) Point绫绘湁鏁板勬暟鎹鎴愬憳镄勫嚱鏁瘅isplay()锛屽叾铡熷瀷涓 void Display(void)(5) Point绫绘湁鏁板勪袱镣硅窛绂荤殑鍑芥暟Distance()(6) 缁椤嚭Line绫荤殑瀹炵幇骞惰捐℃弧瓒崇被瑕佹眰镄凯oint绫(7) 鍒嗘瀽杈揿嚭镄勭粨鏋滐纴镐荤粨鏋勯犲嚱鏁板拰鏋愭瀯鍑芥暟镄勮皟鐢ㄩ‘搴 鎴戠敤镄勭紪璇戠幆澧冩槸VisualC++6.0