码迷,mamicode.com
首页 > 其他好文 > 详细

acm 投简历

时间:2014-06-05 05:35:42      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:c   class   blog   code   a   http   

#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;
}

bubuko.com,布布扣

acm 投简历,布布扣,bubuko.com

acm 投简历

标签:c   class   blog   code   a   http   

原文地址:http://blog.csdn.net/zjx211314/article/details/27353813

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!