答案三

来源:互联网 发布:虚拟光驱for mac 破解 编辑:程序博客网 时间:2024/04/28 07:48

这里写图片描述

class Point{public:    Point(double x,double y,double z)    {        this->x=x;        this->y=y;        this->z=z;    }    Point(const Point& p)    {        this->x=p.x;        this->y=p.y;        this->z=p.z;    }    void negate()    {        x=-x;        y=-y;        z=-z;    }    double norm()    {        return sqrt(x*x+y*y+z*z);    }    void print()    {        cout<<x<<y<<z;    }private:    double x,y,z;};

这里写图片描述

class MyClass{public:    MyClass(int xx=0,int yy=0)    {        X=xx;        Y=yy;    }    MyClass(const MyClass & m);private:    int X,Y;};MyClass::MyClass(const MyClass & m){    X=m.X;    Y=m.Y;}

这里写图片描述
long long solve(int n)
{
return pow(2.0,n+1)-1;
}

0 0
原创粉丝点击