pointdef.cpp

来自「谭浩强 《C++ 程序设计》第三版的部分课后练习题源码」· C++ 代码 · 共 19 行

CPP
19
字号
#include<iostream>
#include"Shape.h"
using namespace std;
class Point:public Shape
{
      private:
              float x,y;
      public:
             Point(float a=0,float b=0):x(a),y(b){}
             void showname() const{ cout<<"the information of a point: ";}
             void display()const;
};        
        
void Point::display()const
{
     cout<<"x="<<x<<"   y="<<y<<endl;
}     
     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?