ojY
来源:互联网 发布:艾瑞app数据 编辑:程序博客网 时间:2024/05/16 18:41
<span style="font-family: Arial, Helvetica, sans-serif;">#include <iostream></span>
using namespace std;class Student{public: void get_value() { cin>>num>>name>>sex; } void display( ) { cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<<"sex: "<<sex<<endl; }private : int num; string name; char sex;};class Student1:private Student{public: void get_value_1() { get_value(); cin>>age>>addr; } void display_1() { display(); cout<<"age: "<<age<<endl; cout<<"address: "<<addr<<endl; }private: int age; string addr;};int main(){ Student1 stud1; stud1.get_value_1(); stud1.display_1(); return 0;}结果:
0 0
- ojY
- CSL_FINST(((CSL_DevRegs*)CSL_DEV_REGS)->PERCFG1, DEV_PERCFG1_EMIFACTL, ENABLE);
- OCR条形码控件字体支持多种格式的OCR字体
- [转] 在Ubuntu上安装PPTP VPN服务
- bar.cnyes.com/html/100102-1/8D15B6BE0848200.shtml
- 我的算法学习之路
- ojY
- POJ3071-Football(概率DP+滚动数组)
- CentOS 6.5中如何由一般用户切换为root用户
- Apache中https的详解及应用案例
- 深入System.Web.Caching命名空间 教你Hold住缓存管理(三)
- OCP 1Z0 052 152
- 数据操作层,泛型基接口的设计
- iOS GCD多线程解析
- UVa 12436 Rip Van Winkle's Code 线段树