# 初学者问 这程序语法错哪了，最好不改主函数

www.MyException.Cn  网友分享于：2013-04-22  浏览：3次

#include"iostream"
#include"iomanip"

using namespace std;
char c1=',';

class Point
{

public:
static int count1,count2;
friend void show();
friend void ShowPoint(Point &p, double x, double y);
Point (double a11,double c11);
Point(double a11);
~Point();
Point (Point &w);
Point ();
Point(const Point&);
void show()
{
cout<<std::setprecision(16)<<"Point["<<i1<<"] : "<<'('<<x1<<c1<<' '<<y1<<')'<<'\n';

}
void show()const
{
cout<<std::setprecision(16)<<"Point["<<i1<<"] : "<<'('<<x1<<c1<<' '<<y1<<')'<<'\n';

}
double x1,y1,aa1,cc1; int i1;
static void showCounter()
{
std::cout<<"Current"<<' '<<":"<<' '<<count1<<' '<< "points.\n";

}
double x(){return x1;}
double x()const{return x1;}
double x(double m){x1=m; return x1;}
double y(double n){y1=n; return y1;}
double y(){return y1;}
double y()const{return y1;}
double getX(){return x1;}
double getY(){return y1;}
double setX(double x){x1=x; return x1;}
double setY(double y){y1=y; return y1;}
Point& setPoint(double a,double b);
double setPoint(double a)
{
x1=a;y1=a;
return x1;
}
static void showSumOfPoint()
{
std::cout<<"In total : "<<count2<< " points.\n";

}
Point copy(Point p)
{
x1=p.x1;
y1=p.y1;
return *this;
}
Point inverse()
{
Point::x1=Point::x1+Point::y1;
Point::y1=Point::x1-Point::y1;
Point::x1=Point::x1-Point::y1;
return *this;
}
Point inverse(Point p)
{
p.x1=p.x1+p.y1;
p.y1=p.x1-p.y1;
p.x1=p.x1-p.y1;
return *this;
}
bool isEqual(Point p)
{
if (p.x1==Point::x1&&p.y1==Point::y1)
return true;
else
return false;
}
bool isEqual(Point p)const
{
if (p.x1==Point::x1&&p.y1==Point::y1)
return true;
else
return false;
}

};
Point::Point(const Point&p):x1(p.x1),y1:(p.y1)
{

}
Point& Point:: setPoint(double a,double b)
{
x1=a,y1=b;
}
Point::Point (double a11,double c11):x1(a11),y1(c11)
{
count2++;