Advertisement
Soverein

Untitled

Apr 28th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 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. cin >> n;
  9. this->Name = new string [n];
  10. this->Init = new string[n];
  11. this->Nomer = new int[n];
  12. this->Adress = new string[n];
  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. cout << "enter number" << endl;
  35. cin >> n;
  36. cin >> this->Nomer[n];
  37. for (int i = 0; i < n; ++i) {
  38. if (this->Nomer[n] = this->Nomer[i]) {
  39. cout << this->Name[i] << "\n";
  40. cout << this->Nomer[i]<<"\n";
  41. cout << this->Init[i]<<"\n";
  42. cout << this->Adress[i]<<"\n";
  43. }
  44. else cout<<"error, go next :)";
  45. }
  46. }
  47. };
  48.  
  49. int main()
  50. {
  51. int kol;
  52. cout << "Enter kol-vo\n";
  53. cin >> kol;
  54. ABONENT* mas = new ABONENT(kol);
  55. mas->zap();
  56. mas->show();
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement