[求助]请问这个程序要怎样改???????#include<iostream.h>
#include<math.h>
class Point
{
public:
Point(double a,double b,double c)
{ x=a;y=b;z=c; };
Point(Point &p);
void negate(double e,double f,double g)
{
x=-e;
y=-f;
z=-g;
}
double norm(double k,double l,double m)
{
double r;
x=k;y=l;z=m;
r=sqrt(x*x+y*y+z*z);
return (r);
}
void print();
~Point(){}
private:
double x,y,z;
};
Point::Point(Point &p)
{
x=p.x;
y=p.y;
z=p.z;
}
void Point::print()
{
cout<<"x="<<x<<" "<<"y="<<y<<" "<<"z="<<z<<endl;
}
double main()
{
Point A(3.00,4.00,5.00);
Point B(A);
B.print();
double destance=A.norm();
cout<<"destance:"<<destance<<"\n";
return 0;
}
我想让它,;输出,negate()是把这个点按照原点对称变换的函数,norm()是求到原点的距离,
它总有一个错误,就是函数没有参数,我不会改,而且不知输出是不是对的............