SDUTOJ 2712 5-2 派生类的构造函数
来源:互联网 发布:阿里云计算机有限公司 编辑:程序博客网 时间:2024/06/11 14:45
#include<iostream>#include<string>using namespace std;class Person{protected:char sex;int age;string name;public:Person(string nam,char s,int a){name=nam;sex=s;age=a;}};class Employee:public Person{private:int salary,leave;public:Employee(string nam,char s,int a,int y,int l):Person(nam,s,a){ salary=y;leave=l;}void show(){cout<<"name"<<":"<<name<<endl;cout<<"age"<<":"<<age<<endl;cout<<"sex"<<":"<<sex<<endl;cout<<"basicSalary"<<":"<<salary<<endl;cout<<"leavedays"<<":"<<leave<<endl;}};int main(){int a,b,c;char e;string f;cin>>f>>e>>a>>b>>c;Employee t(f,e,a,b,c);t.show();return 0;}
0 0
- SDUTOJ 2712 5-2 派生类的构造函数
- SDUTOJ 2713 5-3 多级派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- 5-2 派生类的构造函数
- [2712]5-2 派生类的构造函数
- SDUT 2712 5-2 派生类的构造函数
- c++参数传递方法
- asgterisk sip nat localnet externaddr externhost qualify
- 正铉函数画动态波浪图
- ios-GET和POST
- Spark源码阅读笔记:Spark集群中各个角色介绍
- SDUTOJ 2712 5-2 派生类的构造函数
- Update视图数据(oracle)
- 排序算法
- VS2012 快捷键
- Run Loop详解
- 斐波那契数列-矩阵乘法
- UIImageView userInteractionEnabled
- Android的px、dp和sp
- 【诚邀各位开发者参加】2014-10-25 深圳OGEngine手游开发者交流会议