Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class ABONENT {
- public:
- ABONENT(int nomeer) {
- this->n = nomeer;
- cin >> n;
- this->Name = new string [n];
- this->Init = new string[n];
- this->Nomer = new int[n];
- this->Adress = new string[n];
- }
- string* Name;
- string* Init;
- int* Nomer;
- string* Adress;
- int n;
- void zap()
- {
- for (int i = 0; i < n; ++i)
- {
- cout<<"enter name\n ";
- cin >> this->Name[i];
- cout << "enter init: \n";
- cin >> this->Init[i];
- cout << "nomer : \n";
- cin >> this->Nomer[i];
- cout << "adress \n";
- cin >> this->Adress[i];
- }
- }
- void show() {
- cout << "enter number" << endl;
- cin >> n;
- cin >> this->Nomer[n];
- for (int i = 0; i < n; ++i) {
- if (this->Nomer[n] = this->Nomer[i]) {
- cout << this->Name[i] << "\n";
- cout << this->Nomer[i]<<"\n";
- cout << this->Init[i]<<"\n";
- cout << this->Adress[i]<<"\n";
- }
- else cout<<"error, go next :)";
- }
- }
- };
- int main()
- {
- int kol;
- cout << "Enter kol-vo\n";
- cin >> kol;
- ABONENT* mas = new ABONENT(kol);
- mas->zap();
- mas->show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement