您的位置:首页 > 其它

2-1 Point类的定义

2016-09-21 19:31 134 查看
#include<iostream>
using namespace std;
class point
{
private:
int x;int y;
public:
void setpoint( )
{
x=10;y=11;
}
void showpoint()
{
cout<<"("<<x<<","<<y<<")"<<endl;
}
};
int main()
{
class point t;
t.setpoint();
t.showpoint();
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: