#include <iostream>
using namespace std;
class CPoint{
public:
int cx;
int cy;
CPoint()
{
cx = 0;
cy = 0;
}
CPoint(int a, int b)
{
cx = a;
cy = b;
}
void input(int cx, int cy)
{
this->cx = cx;
this->cy = cy;
}
//上下俩函数的不同之处
/*
void input(int cx, int cy)
{
cx = cx;
cy = cy;
}
*/
void coutput()
{
cout << cx << endl << cy << endl;
}
};
int main()
{
CPoint cp(5,5);
cp.input(10,10);
cp.coutput();
return 0;
}
using namespace std;
class CPoint{
public:
int cx;
int cy;
CPoint()
{
cx = 0;
cy = 0;
}
CPoint(int a, int b)
{
cx = a;
cy = b;
}
void input(int cx, int cy)
{
this->cx = cx;
this->cy = cy;
}
//上下俩函数的不同之处
/*
void input(int cx, int cy)
{
cx = cx;
cy = cy;
}
*/
void coutput()
{
cout << cx << endl << cy << endl;
}
};
int main()
{
CPoint cp(5,5);
cp.input(10,10);
cp.coutput();
return 0;
}