Advertisement
Soverein

Untitled

Apr 28th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. class ABONENT {
  5. public:
  6. ABONENT(int nomeer) {
  7. this->n = nomeer;
  8. this->Name = new string[n];
  9. this->Init = new string[n];
  10. this->Nomer = new int[n];
  11. this->Adress = new string[n];
  12. zap();
  13. }
  14. string* Name;
  15. string* Init;
  16. int* Nomer;
  17. string* Adress;
  18. int n;
  19. void zap()
  20. {
  21. for (int i = 0; i < n; ++i)
  22. {
  23. cout << "enter name\n ";
  24. cin >> this->Name[i];
  25. cout << "enter init: \n";
  26. cin >> this->Init[i];
  27. cout << "nomer : \n";
  28. cin >> this->Nomer[i];
  29. cout << "adress \n";
  30. cin >> this->Adress[i];
  31. }
  32. }
  33. void show() {
  34. int EntNum;
  35. cout << "enter number" << endl;
  36. cin >> EntNum;
  37. for (int i = 0; i < n; ++i) {
  38. if (this->Nomer[i] = EntNum) {
  39. cout << "I found it)\n";
  40. cout << this->Nomer[i] << " ";
  41. cout << this->Init[i] << " ";
  42. cout << this->Adress[i] << " ";
  43. cout << "/operation succes\n";
  44. }
  45. else cout << "error, go next :)";
  46. continue;
  47. }
  48. }
  49. };
  50. int main()
  51. {
  52. int kol;
  53. cout << "Enter kol-vo\n";
  54. cin >> kol;
  55. ABONENT* mas = new ABONENT(kol);
  56. mas->show();
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement