1个回答
展开全部
#include<iostream>
#include<fstream>
#include<string>
#include<cstring>
using namespace std;
class Point{
private:
int x;
int y;
int z;
public:
Point(int x,int y,int z=0)
{
this->x=x;
this->y=y;
this->z=z;
}
void print()
{
cout<<"x: "<<x<<" y: "<<y<<" z: "<<z<<endl;
}
};
int main()
{
Point po(1,2);
po.print();
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询