@mrguseynov
2 / 2 / 1
Регистрация: 06.11.2014
Сообщений: 28
|
10.07.2015, 11:03
[ТС]
|
|
aLarman, Спасибо,помогло
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #include <iostream>
#include <string>
using namespace std;
class Informat
{
public:
void set_name(string sax){name=sax;}
void set_position(string tan){position=tan;}
void set_age(int asa){age=asa;}
protected:
string name;
string position;
int age;
};
class Medic:public Informat
{
public:
string get_name(){return name;}
string get_position(){return position;}
int get_age(){return age;}
};
int main()
{
Medic Obj;
Obj.set_name("Yura");
Obj.set_position("Therapist");
Obj.set_age(55);
cout<<"Imya: "<<Obj.get_name()<<endl;
cout<<"Doljnost: "<<Obj.get_position()<<endl;
cout<<"Vozrast: "<<Obj.get_age()<<endl;
return 0;
} |
|
0
|