forbidden.cpp
来自「写了一个小程序」· C++ 代码 · 共 40 行
CPP
40 行
#include "iostream.h"
namespace
{
class coordinate
{
int x;
int y;
public:
coordinate(int a,int b)
{
x = a;
y = b;
}
int GetX() const
{
return x;
}
int GetY() const
{
return y;
}
};
}
class Derived:public coordinate
{
public:
Derived(int a,int b):coordinate(a,b)
{
}
void Output()
{
cout<<GetX()<<GetY()<<endl;
}
};
void main()
{
Derived d(3,5);
d.Output();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?