Advertisement
AyratT

7.Вещественные числа и задача о задачах

Oct 23rd, 2022 (edited)
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.98 KB | Help | 0 0
  1.  
  2. void PrintTasksInfo(TasksInfo tasks_info) {
  3.     cout << tasks_info[TaskStatus::NEW] << "/"s
  4.         << tasks_info[TaskStatus::IN_PROGRESS] << "/"s
  5.         << tasks_info[TaskStatus::TESTING] << "/"s
  6.         << tasks_info[TaskStatus::DONE] << ""s << endl;
  7. }
  8.  
  9. int main() {
  10.     TeamTasks tasks;
  11.     for (int i = 0; i < 5; ++i) {
  12.         tasks.AddNewTask("Ivan"s);
  13.     }
  14.     for (int i = 0; i < 0; ++i) {
  15.         tasks.AddIN_PROGRESSTask("Ivan"s);
  16.     }
  17.     for (int i = 0; i < 0; ++i) {
  18.         tasks.AddTESTINGTask("Ivan"s);
  19.     }
  20.     for (int i = 0; i < 0; ++i) {
  21.         tasks.AddDONEask("Ivan"s);
  22.     }
  23.  
  24.     cout << "Ivan's tasks before: "s;
  25.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  26.  
  27.     TasksInfo updated_tasks, untouched_tasks;
  28.  
  29.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 6);
  30.     cout << "PerformPersonTasks(6)" << endl;
  31.     cout << "Updated Ivan's tasks: "s;
  32.     PrintTasksInfo(updated_tasks);
  33.     cout << "Untouched Ivan's tasks: "s;
  34.     PrintTasksInfo(untouched_tasks);
  35.     cout << "Ivan's tasks after: "s;
  36.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  37.     cout << endl;
  38.     for (int i = 0; i < 1200; ++i) {
  39.         tasks.AddNewTask("Ivan"s);
  40.     }
  41.     for (int i = 0; i < 2; ++i) {
  42.         tasks.AddIN_PROGRESSTask("Ivan"s);
  43.     }
  44.     for (int i = 0; i < 2; ++i) {
  45.         tasks.AddTESTINGTask("Ivan"s);
  46.     }
  47.     for (int i = 0; i < 16; ++i) {
  48.         tasks.AddDONEask("Ivan"s);
  49.     }
  50.  
  51.     cout << "Ivan's tasks before: "s;
  52.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  53.  
  54.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 1206);
  55.     cout << "PerformPersonTasks(1206)" << endl;
  56.     cout << "Updated Ivan's tasks: "s;
  57.     PrintTasksInfo(updated_tasks);
  58.     cout << "Untouched Ivan's tasks: "s;
  59.     PrintTasksInfo(untouched_tasks);
  60.     cout << "Ivan's tasks after: "s;
  61.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  62.     cout << endl;
  63.  
  64.  
  65.     for (int i = 0; i < 1; ++i) {
  66.         tasks.AddNewTask("Ivan"s);
  67.     }
  68.     for (int i = 0; i < 2; ++i) {
  69.         tasks.AddIN_PROGRESSTask("Ivan"s);
  70.     }
  71.     for (int i = 0; i < 3; ++i) {
  72.         tasks.AddTESTINGTask("Ivan"s);
  73.     }
  74.     for (int i = 0; i < 4; ++i) {
  75.         tasks.AddDONEask("Ivan"s);
  76.     }
  77.  
  78.     cout << "Ivan's tasks before: "s;
  79.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  80.  
  81.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 1000);
  82.     cout << "PerformPersonTasks(1000)" << endl;
  83.     cout << "Updated Ivan's tasks: "s;
  84.     PrintTasksInfo(updated_tasks);
  85.     cout << "Untouched Ivan's tasks: "s;
  86.     PrintTasksInfo(untouched_tasks);
  87.     cout << "Ivan's tasks after: "s;
  88.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  89.     cout << endl;
  90.  
  91.     for (int i = 0; i < 1; ++i) {
  92.         tasks.AddNewTask("Ivan"s);
  93.     }
  94.     for (int i = 0; i < 0; ++i) {
  95.         tasks.AddIN_PROGRESSTask("Ivan"s);
  96.     }
  97.     for (int i = 0; i < 0; ++i) {
  98.         tasks.AddTESTINGTask("Ivan"s);
  99.     }
  100.     for (int i = 0; i < 0; ++i) {
  101.         tasks.AddDONEask("Ivan"s);
  102.     }
  103.  
  104.     cout << "Ivan's tasks before: "s;
  105.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  106.  
  107.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 1);
  108.     cout << "PerformPersonTasks(1)" << endl;
  109.     cout << "Updated Ivan's tasks: "s;
  110.     PrintTasksInfo(updated_tasks);
  111.     cout << "Untouched Ivan's tasks: "s;
  112.     PrintTasksInfo(untouched_tasks);
  113.     cout << "Ivan's tasks after: "s;
  114.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  115.     cout << endl;
  116.  
  117.     for (int i = 0; i < 1; ++i) {
  118.         tasks.AddNewTask("Ivan"s);
  119.     }
  120.     for (int i = 0; i < 0; ++i) {
  121.         tasks.AddIN_PROGRESSTask("Ivan"s);
  122.     }
  123.     for (int i = 0; i < 12; ++i) {
  124.         tasks.AddTESTINGTask("Ivan"s);
  125.     }
  126.     for (int i = 0; i < 3; ++i) {
  127.         tasks.AddDONEask("Ivan"s);
  128.     }
  129.  
  130.     cout << "Ivan's tasks before: "s;
  131.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  132.  
  133.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 100);
  134.     cout << "PerformPersonTasks(100)" << endl;
  135.     cout << "Updated Ivan's tasks: "s;
  136.     PrintTasksInfo(updated_tasks);
  137.     cout << "Untouched Ivan's tasks: "s;
  138.     PrintTasksInfo(untouched_tasks);
  139.     cout << "Ivan's tasks after: "s;
  140.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  141.     cout << endl;
  142.  
  143.     for (int i = 0; i < 5; ++i) {
  144.         tasks.AddNewTask("Ivan"s);
  145.     }
  146.     for (int i = 0; i < 5; ++i) {
  147.         tasks.AddIN_PROGRESSTask("Ivan"s);
  148.     }
  149.     for (int i = 0; i < 5; ++i) {
  150.         tasks.AddTESTINGTask("Ivan"s);
  151.     }
  152.     for (int i = 0; i < 0; ++i) {
  153.         tasks.AddDONEask("Ivan"s);
  154.     }
  155.  
  156.     cout << "Ivan's tasks before: "s;
  157.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  158.  
  159.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 10);
  160.     cout << "PerformPersonTasks(10)" << endl;
  161.     cout << "Updated Ivan's tasks: "s;
  162.     PrintTasksInfo(updated_tasks);
  163.     cout << "Untouched Ivan's tasks: "s;
  164.     PrintTasksInfo(untouched_tasks);
  165.     cout << "Ivan's tasks after: "s;
  166.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  167.     cout << endl;
  168.  
  169.  
  170.     for (int i = 0; i < 5; ++i) {
  171.         tasks.AddNewTask("Ivan"s);
  172.     }
  173.     for (int i = 0; i < 5; ++i) {
  174.         tasks.AddIN_PROGRESSTask("Ivan"s);
  175.     }
  176.     for (int i = 0; i < 0; ++i) {
  177.         tasks.AddTESTINGTask("Ivan"s);
  178.     }
  179.     for (int i = 0; i < 0; ++i) {
  180.         tasks.AddDONEask("Ivan"s);
  181.     }
  182.  
  183.     cout << "Ivan's tasks before: "s;
  184.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  185.  
  186.     tie(updated_tasks, untouched_tasks) = tasks.PerformPersonTasks("Ivan"s, 5);
  187.     cout << "PerformPersonTasks(5)" << endl;
  188.     cout << "Updated Ivan's tasks: "s;
  189.     PrintTasksInfo(updated_tasks);
  190.     cout << "Untouched Ivan's tasks: "s;
  191.     PrintTasksInfo(untouched_tasks);
  192.     cout << "Ivan's tasks after: "s;
  193.     PrintTasksInfo(tasks.GetPersonTasksInfo("Ivan"s));
  194.     cout << endl;
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement