Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5. using namespace std;
  6. class person
  7. {
  8. private:
  9. string name, s_name;
  10. int age;
  11. public:
  12.     void set_info(string name, string s_name, int age)
  13.     {
  14.         name=name;
  15.         s_name=s_name;
  16.         age=age;
  17.     }
  18.     void get_info()
  19.     {
  20.         cout<<"saxelia"<<name;
  21.         cout<<"gvaria"<<s_name;
  22.         cout<<"asakia"<<age;
  23.     }
  24.     };
  25.  
  26.     class my_class
  27. {
  28. private:
  29. string c_name;
  30. int raod;
  31. vector<person>moswavleebi;
  32. person maswavlebeli;
  33. public:
  34.     void get_info(string c_name, int raod, person maswavlebeli)
  35.     {
  36.         c_name=c_name;
  37.         raod=raod;
  38.         maswavlebeli=maswavlebeli;
  39.     }
  40.     void cout_info()
  41.     {
  42.         for (int i = 0; i < moswavleebi.size(); ++i)
  43.         {
  44.             cout<<moswavleebi[i];
  45.         }
  46.     }
  47.     void get_t_info()
  48.     {
  49.         return maswavlebeli.get_info();
  50.     }
  51.     string class_name()
  52.     {
  53.         return c_name;
  54.     }
  55.     int number_info()
  56.     {
  57.         return raod;
  58.     }
  59. };
  60. int main()
  61. {
  62. string name, s_name;
  63. int age;
  64. string c_name;
  65. int raod;
  66. cin>>raod;s
  67. vector<person>moswavleebi;
  68. person maswavlebeli;
  69. my_class m;
  70. person p;
  71. for (int i = 0; i <raod; ++i)
  72. {
  73. p.set_info(name,s_name,age);
  74. moswavleebi.push_back(p);
  75. m.get_info(c_name,raod,maswavlebeli);
  76. }
  77. p.get_info();
  78. m.cout_info();
  79. m.get_t_info();
  80. m.class_name();
  81. m.number_info();
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement