Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "stdio.h"
- #include <iostream>
- using namespace std;
- class book {
- private:
- float cost;
- char name[128], autor[128];
- public:
- book() {
- cout << "Введите название книги: ";
- cin.getline(name, 128);
- cout << "Введите автора (в родительном падеже): ";
- cin.getline(autor, 128);
- cout << "Введите цену: ";
- cin >> cost;
- }
- void getData() //Output
- {
- cout << "\n Вы внесли в список книгу: " << name<< ", за авторством: " << autor <<", и выставили цену: "<<cost << endl ;
- }
- ~book()
- {
- cout << "\n Работа с класом завершена!" << endl;
- system("pause");
- }
- };
- int main()
- {
- setlocale(LC_ALL, "rus");
- book tolstoy;
- tolstoy.getData();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement