Father.cpp:

 #include<iostream>
using namespace std;
class Father
{
protected:
int width;
int height;
public:
void setWidth(int widths)
{
width = widths;
}
void setHeight(int heights)
{
height = heights;
}
}; class Son : public Father
{
private:
int weight;
public:
void setWeight(int weights)
{
weight = weights;
}
void show()
{
cout<<"width ="<<width<<"\t"<<"height="<<height<<"\t"<<"weight="<<weight<<endl;
}
}; int main()
{
Son a;
a.setWeight();
a.setHeight();
a.setWidth();
a.show();
return ;
}

运行结果:

最新文章

  1. 理解 Neutorn LBaaS - 每天5分钟玩转 OpenStack(120)
  2. linux 学习 13 系统管理
  3. 网络编程socket基本API详解(转)
  4. ABAP之DIALOG
  5. Java:静态导入
  6. JavaScript中bind、call、apply函数用法详解
  7. C++之sort函数
  8. selenium 多线程
  9. OPEN A PO ORDER OR SO ORDER
  10. spring security5.0源码导入idea
  11. Excel Foundation Install
  12. 闪付卡(QuickPass)隐私泄露原理
  13. POJ 3461 Oulipo(模式串在主串中出现次数 可重叠)
  14. taro 事件处理
  15. 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type &#39;com.dao.UserMapper&#39; that could not be found.
  16. &lt;Lord don’t move that mountain&gt;
  17. delphi程序中定义热键
  18. net core 发布到服务器的方式
  19. Charles下载和使用
  20. js 数据格式化

热门文章

  1. Write-Up-wakanda-1
  2. 学习之学习--混沌大学商学院--第一课--HHR计划
  3. CentOS修改各大yum源(centos5,centos6,centos7)
  4. 【快学Docker】Docker镜像相关操作
  5. Spring学习(三)
  6. Caffe2 的基本数据结构(Basics of Caffe2 - Workspaces, Operators, and Nets)[4]
  7. RESTFul Client入门实例
  8. uniapp - 导航切换(样式)
  9. 前后端分离后API交互如何保证数据安全性?
  10. error C4996: &#39;fopen&#39;: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation