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;
- this->Name = new string[n];
- this->Init = new string[n];
- this->Nomer = new int[n];
- this->Adress = new string[n];
- zap();
- }
- 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() {
- int EntNum;
- cout << "enter number" << endl;
- cin >> EntNum;
- for (int i = 0; i < n; ++i) {
- if (this->Nomer[i] = EntNum) {
- cout << "I found it)\n";
- cout << this->Nomer[i] << " ";
- cout << this->Init[i] << " ";
- cout << this->Adress[i] << " ";
- cout << "/operation succes\n";
- }
- else cout << "error, go next :)";
- continue;
- }
- }
- };
- int main()
- {
- int kol;
- cout << "Enter kol-vo\n";
- cin >> kol;
- ABONENT* mas = new ABONENT(kol);
- mas->show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement