首页 > 代码库 > acm 投简历
acm 投简历
#include <iostream>#include <string>using namespace std;class jianli{public: void getvalue() { cin>>name>>age>>sex>>major; } void display() { cout<<"name:"<<name<<endl; cout<<"age:"<<age<<endl; cout<<"sex:"<<sex<<endl; cout<<"major:"<<major<<endl; }private: string name; int age; char sex; string major;};class jianli1:public jianli{public: void getvalue1() { cin>>school; } void display1() { cout<<"school:"<<school<<endl; }private: string school;};class jianli2:public jianli{public: void getvalue2() { cin>>pay; } void display2() { cout<<"pay:"<<endl; }private: double pay;};int main(){ jianli1 xiaohua; jianli2 xiaohua2; string a="langchao",b="lenovo"; string c; xiaohua.getvalue(); xiaohua.getvalue1(); xiaohua2.getvalue2(); cin>>c; if(c==a) { xiaohua.display(); xiaohua.display1(); } if(c==b) { xiaohua.display(); xiaohua2.display2(); } return 0;}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。