中易网

c++问题 平面上的点——Point类 (II)

答案:2  悬赏:40  
解决时间 2021-02-15 00:04
c++问题 平面上的点——Point类 (II)
最佳答案
#include
using namespace std;

class Point{
int x, y;
public:
Point(int px=0,int py=0){
x=px; y=py;
cout <<"Point : (" < }
Point(const Point& pt){
x=pt.x; y=pt.y;
cout <<"Point : (" < }
~Point(){
cout <<"Point : (" < }
void show(){
cout <<"Point : (" < }
};
//Append Code
//append.cc,
int main()
{
char c;
double a, b;
Point q;
while(std::cin>>a>>c>>b)
{
Point p(a, b);
p.show();
}
Point q1(q), q2(1);
q1.show();
q2.show();
q.show();
}
全部回答
append code: class point{ int x, y; public: point(int px=0,int py=0){ x=px; y=py; cout <<"point : (" <
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯