Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- #include <conio.h>
- using namespace std;
- const int dl=40;
- class book{
- char nazvanie[dl];
- char izdatelstvo[dl];
- public:
- book(){
- cout<<"Vvedite nazvanie:"<<endl;
- cin>>nazvanie;
- cout<<"Vvedite izdatelstvo:"<<endl;
- cin>>izdatelstvo;
- }
- void show_book(){
- cout<<"======================="<<endl;
- cout<<"Nazvanie:"<<nazvanie<<endl;
- cout<<"Izdatelstvo:"<<izdatelstvo<<endl;
- }
- };
- class autor{
- char fio[dl];
- int god;
- public:
- autor(){
- cout<<"Vvedite FIO:"<<endl;
- cin>>fio;
- cout<<"Vvedite god rozhdenia:"<<endl;
- cin>>god;
- }
- void show_autor(){
- cout<<"FIO:"<<fio<<endl;
- cout<<"God rozhdenia:"<<god<<endl;
- }
- };
- class proizv: public book,public autor{};
- int main(){
- proizv p1;
- p1.show_book();
- p1.show_autor();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment