精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • 定義一個(gè)Point類并用成員函數(shù) double Distance(const& Point)求兩點(diǎn)間距離

    定義一個(gè)Point類并用成員函數(shù) double Distance(const& Point)求兩點(diǎn)間距離
    #include
    #include
    using namespace std;
    class Point
    {
    private:
    double X,Y;
    public:
    Point(double x,double y)
    {
    X=x;
    Y=y;
    }//構(gòu)造函數(shù)
    double GetX()
    {
    return X;
    }
    double GetY()
    {
    return Y;
    }
    double Distance(const& Point)
    { double d;
    return d=sqrt((Point.X-X)*(Point.X-X)+(Point.Y-Y)*(Point.Y-Y));
    }
    void show()
    {
    cout
    其他人氣:369 ℃時(shí)間:2020-06-18 19:07:50
    優(yōu)質(zhì)解答
    #include
    #include
    using namespace std;
    class Point
    {
    private:
    double X,Y;
    public:
    Point(double x,double y)
    {
    X=x;
    Y=y;
    }//構(gòu)造函數(shù)
    double GetX()
    {
    return X;
    }
    double GetY()
    {
    return Y;
    }
    double Distance(const Point &p) //傳入對(duì)象引用
    {
    return sqrt((X-p.X)*(X-p.X)+(Y-p.Y)*(Y-p.Y));
    }
    void show(const Point &p)
    {
    cout
    我來回答
    類似推薦
    請(qǐng)使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版