2668-Point类的定义
2017-09-23 00:29
295 查看
#include <bits/stdc++.h> #define Max 1010000 using namespace std; class Point{ int x,y; public: void SetPoint(int x, int y) { this->x = x; this->y = y; } void ShowPoint() { cout << "(" << x << "," << y << ")" << endl; } }; int main() { Point point; point.SetPoint(10,11); point.ShowPoint(); return 0; }
相关文章推荐
- 2-1 Point类的定义
- 编写程序定义Point类,有数据成员X,Y,为其定义友元函数实现重载+。
- 2-1 Point类的定义
- 定义Point类的无参数构造函数,将point对象的数据成员初始化为0。
- (C++)类与对象2-1 Point类的定义
- C++ 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义
- sdut 2-1 Point类的定义
- 2-1 Point类的定义
- 2-1 Point类的定义