dariagalich

Untitled

Dec 8th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <math.h>
  5. #include <conio.h>
  6.  
  7. using namespace std;
  8.  
  9. const int dl=40;
  10.  
  11. class book{
  12. char nazvanie[dl];
  13. char izdatelstvo[dl];
  14. public:
  15. book(){
  16. cout<<"Vvedite nazvanie:"<<endl;
  17. cin>>nazvanie;
  18. cout<<"Vvedite izdatelstvo:"<<endl;
  19. cin>>izdatelstvo;
  20. }
  21. void show_book(){
  22. cout<<"======================="<<endl;
  23. cout<<"Nazvanie:"<<nazvanie<<endl;
  24. cout<<"Izdatelstvo:"<<izdatelstvo<<endl;
  25. }
  26. };
  27. class autor{
  28. char fio[dl];
  29. int god;
  30. public:
  31. autor(){
  32. cout<<"Vvedite FIO:"<<endl;
  33. cin>>fio;
  34. cout<<"Vvedite god rozhdenia:"<<endl;
  35. cin>>god;
  36. }
  37. void show_autor(){
  38. cout<<"FIO:"<<fio<<endl;
  39. cout<<"God rozhdenia:"<<god<<endl;
  40. }
  41. };
  42.  
  43. class proizv: public book,public autor{};
  44.  
  45. int main(){
  46. proizv p1;
  47. p1.show_book();
  48. p1.show_autor();
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment