Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. // 21.04.2019
  6.  
  7. class Worker
  8. {
  9. string name;
  10. string date_of_birth;
  11. string department_name;
  12. string position;
  13. string beginning_date;
  14. public:
  15. Worker(string name, string date_of_birth, string department_name, string position, string beginning_date)
  16. {
  17. this->name = name;
  18. this->date_of_birth = date_of_birth;
  19. this->department_name = department_name;
  20. this->position = position;
  21. this->beginning_date = beginning_date;
  22. }
  23. string GetName()
  24. {
  25. return this->name;
  26. }
  27. string GetDateOfBirth()
  28. {
  29. return this->date_of_birth;
  30. }
  31. string GetDepartmentName()
  32. {
  33. return this->department_name;
  34. }
  35.  
  36. string GetPosition()
  37. {
  38. return this->position;
  39. }
  40. string GetBeginningDate()
  41. {
  42. return this->beginning_date;
  43. }
  44. };
  45.  
  46. /*string GetString(string current, int position, int symbols)
  47. {
  48. return current.substr(position, symbols);
  49. }
  50.  
  51. bool CompareWorkers(Worker first_worker, Worker second_worker)
  52. {
  53. string first_worker_date = first_worker.GetBeginningDate();
  54. string second_worker_date = second_worker.GetBeginningDate();
  55. string first_worker_year = GetString(first_worker_date, 5, 5);
  56. string second_worker_year = GetString(second_worker_date, 5, 5);
  57. string first_worker_month = GetString(first_worker_date, 3, 2);
  58. string second_worker_month = GetString(second_worker_date, 3, 2);
  59. string first_worker_day = GetString(first_worker_date, 0, 2)
  60. return Convert(first_worker.beginning_date) < Convert(second_worker.beginning_date);
  61. }*/
  62.  
  63. void Solve()
  64. {
  65. vector<Worker> workers;
  66. int n;
  67. cin >> n;
  68. for (int i = 0; i < n; i++)
  69. {
  70. string name;
  71. string date_of_birth;
  72. string department_name;
  73. string position;
  74. string beginning_date;
  75. cin >> name >> date_of_birth >> department_name >> position >> beginning_date;
  76. Worker current_worker(name, date_of_birth, department_name, position, beginning_date);
  77. workers.push_back(current_worker);
  78. }
  79. }
  80.  
  81. int main()
  82. {
  83. Solve();
  84. return 0;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement