edgarrii

coursework

May 6th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 45.85 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <Windows.h>
  4. #include <fstream>
  5. #include <conio.h>
  6. #include <iomanip>
  7.  
  8.  
  9. using namespace std;
  10.  
  11. struct Account {
  12.     string log;
  13.     string pas;
  14.     int prava;
  15. };
  16.  
  17. struct Project {
  18.     string name_project;
  19.     string vid_rab;
  20.     string FIO;
  21.     string kolvo_chas;
  22.     string stoimost_chas;
  23. };
  24.  
  25. struct IndvZad {
  26.     string name_proj;
  27.     int kolvo_sotrud;
  28.     int stoimost_proekta;
  29.     int perechen_rabot[5];
  30.     int perechen_rabot_st[5] = { 0, 0, 0 ,0 ,0 };
  31. };
  32.  
  33. int zapolAccoountov(Account*, int);
  34. int vxod();
  35. string proverkaLogina(Account*, int);
  36. string provPass(string);
  37. int zapolFileAccount(Account*, int);
  38. string provLogin(Account*, int);
  39. string provekraParolya(Account*, int, string);
  40. string vvodParolya();
  41. int menuAdministratora(Account*, int, string);
  42. int vivodMenuAdmin(string);
  43. void menuPolzovetlAdmin(Account*, int);
  44. int vivodMenuAccounta();
  45. int vivodInfPolzovatel(Account*, int);
  46. int proverkaPravPolzovatelya();
  47. int korektAccount(Account*, int);
  48. int viborRedaktAccount(Account*, int);
  49. void menuRedaktDannyh();
  50. void zapolnenieProj(Project*, int);
  51. int vivodMenuRedaktInf();
  52. void vivodProj(Project*, int);
  53. int dobavlenieProject(Project*, int);
  54. string vvodFIO();
  55. string vvodProj();
  56. string provVidaRab();
  57. string provStoimostChas();
  58. int redakProj(Project*, int);
  59. int viborRedakt(Project*, int);
  60. void zapFileProj(Project*, int);
  61. void menuObrabDannyh(string);
  62. int vivodMenuObrabotki(string);
  63. int vivodMenuPoiska();
  64. void menuPoiska(Project*, int, int);
  65. void vivodProj1(Project*, int);
  66. int vivodMenuSort();
  67. void menuSort(Project*, int, int);
  68. void indvZadanie(Project*, int);
  69.  
  70.  
  71. int main() {
  72.     setlocale(0, "rus");
  73.     ifstream fin;
  74.     ofstream fout;
  75.     ifstream check;
  76.     check.open("Project.txt");
  77.     if (!check) {
  78.         fout.open("Project.txt", ios::out);
  79.         fout.close();
  80.     }
  81.     check.close();
  82.     check.open("registr.txt");
  83.     if (!check) {
  84.         fout.open("registr.txt", ios::out);
  85.         fout.close();
  86.     }
  87.     check.close();
  88.     ifstream file("Project.txt", ios::in);
  89.     file.seekg(0, ios::end);
  90.     int file_size = file.tellg();
  91.     if (file_size == 0) {
  92.         ofstream file1("Project.txt", ios::out);
  93.         file1 << "0" << endl;
  94.         file1.close();
  95.     }
  96.     file.close();
  97.     ifstream f("registr.txt", ios::in);
  98.     f.seekg(0, ios::end);
  99.     file_size = f.tellg();
  100.     if (file_size == 0) {
  101.         ofstream file1("registr.txt", ios::out);
  102.         file1 << "0" << endl;
  103.         file1 << "edgar" << endl;
  104.         file1 << "12345" << endl;
  105.         file1 << "1" << endl;
  106.         file1 << "1" << endl;
  107.         file1.close();
  108.     }
  109.     f.close();
  110.     fin.open("registr.txt");
  111.     fin.seekg(-3, ios::end);
  112.     int n;
  113.     fin >> n;
  114.     fin.close();
  115.     Account* Acc = new Account[n];
  116.     zapolAccoountov(Acc, n);
  117.     while (true) {
  118.         string login, pass;
  119.         int key = vxod();
  120.         if (key == 2) { cout << "Досвидания!!!"; return 0; }
  121.         else
  122.             if (key == 1) {
  123.                 Account* t = new Account[n + 1];
  124.                 copy(Acc, Acc + n, t);
  125.                 delete[]Acc;
  126.                 Acc = t;
  127.                 t = NULL;
  128.                 zapolAccoountov(Acc, n);
  129.                 login = proverkaLogina(Acc, n);
  130.                 pass = provPass(login);
  131.                 fstream clear_file("registr.txt", ios::out);
  132.                 clear_file.close();
  133.                 Acc[n].log = login; Acc[n].pas = pass; Acc[n].prava = 0;
  134.                 zapolFileAccount(Acc, n);
  135.                 n++;
  136.                 system("cls");
  137.             }
  138.             else
  139.                 if (key == 0) {
  140.                     login = provLogin(Acc, n);
  141.                     pass = provekraParolya(Acc, n, login);
  142.                     if (pass == "1") continue;
  143.                     int nomer = -1;
  144.                     for (int i = 0; i < n; i++)
  145.                         if (Acc[i].log == login) { nomer = i; }
  146.                     if (Acc[nomer].prava == 1) {
  147.                         menuAdministratora(Acc, n, login);
  148.                     }
  149.                     else {
  150.                         menuObrabDannyh(login);
  151.                     }
  152.                 }
  153.     }
  154.     return 0;
  155. }
  156.  
  157. int zapolAccoountov(Account* Acc, int n) {
  158.     ifstream fi;
  159.     fi.open("registr.txt", ios::in);
  160.     int k, prav;
  161.     string lo, pa;
  162.     fi >> k;
  163.     for (int i = 0; i < n; i++) {
  164.         fi >> lo;
  165.         fi >> pa;
  166.         fi >> prav;
  167.         Acc[i].log = lo;
  168.         Acc[i].pas = pa;
  169.         Acc[i].prava = prav;
  170.         fi >> k;
  171.     }
  172.     fi.close();
  173.     return 0;
  174. }
  175.  
  176. int vxod() {
  177.     int kol = 0, key = 0;
  178.     while (true) {
  179.         cout << "Стрелками ВВЕРХ и ВНИЗ выберите меню" << endl;
  180.         kol = (kol + 3) % 3;
  181.         if (kol == 0) { cout << " -- Войти в уже существующий аккаунт" << endl; }
  182.         else cout << " Войти в уже существующий аккаунт" << endl;
  183.  
  184.         if (kol == 1) { cout << " -- Создать новый аккаунт" << endl; }
  185.         else cout << " Создать новый аккаунт" << endl;
  186.  
  187.         if (kol == 2) { cout << " -- Завершить программу" << endl; }
  188.         else { cout << " Завершить программу" << endl; }
  189.  
  190.         key = _getch();
  191.         if (key == 224) {
  192.             key = _getch();
  193.             if (key == 72) kol--;
  194.             if (key == 80) kol++;
  195.         }
  196.         if (key == 13) { system("cls"); return kol; }
  197.         system("cls");
  198.     }
  199. }
  200.  
  201. string proverkaLogina(Account* Acc, int n1) {
  202.     cout << "Логин должне содержать только буквы латинского алфавита, цифры." << endl;
  203.     cout << "Введите ваш логин: ";
  204.     string s;
  205.     while (true) {
  206.         int prov = 0;
  207.         getline(cin, s);
  208.         int n = s.length();
  209.         for (int i = 0; i < n; i++) {
  210.             if ((s[i] < 'a' || s[i] > 'z') && (s[i] < 'A' || s[i] > 'Z') && (s[i] < '0' || s[i] > '9')) {
  211.                 prov = 1;
  212.             }
  213.         }
  214.  
  215.         for (int i = 0; i < n1; i++) {
  216.             if (s == Acc[i].log) prov = 3;
  217.         }
  218.  
  219.  
  220.         if (prov == 3) {
  221.             system("cls");
  222.             cout << "Такой логин уже существует" << endl;
  223.             cout << "Логин может содержать буквы латинского алфавита, цифры" << endl;
  224.             cout << "Введите логин: ";
  225.         }
  226.         else
  227.             if (prov == 0) { return s; }
  228.             else {
  229.                 system("cls");
  230.                 cout << "Логин может содержать буквы латинского алфавита, цифры" << endl;
  231.                 cout << "Введите логин: ";
  232.             }
  233.     }
  234. }
  235.  
  236. string provPass(string login) {
  237.     system("cls");
  238.     cout << "Логин: " << login << endl;
  239.     cout << "Пароль должен состоять из более цифр и латинских буквы." << endl;
  240.     cout << "Введите пароль: ";
  241.     string s;
  242.     while (true) {
  243.         int prov = 0, kolchi = 0, bol = 0, mal = 0;
  244.         getline(cin, s);
  245.         int n = s.length();
  246.         for (int i = 0; i < n; i++) {
  247.             if ((s[i] < 'a' || s[i] > 'z') && (s[i] < 'A' || s[i] > 'Z') && (s[i] < '0' || s[i] > '9')) {
  248.                 prov = 1;
  249.             }
  250.             if (s[i] >= '0' && s[i] <= '9') {
  251.                 kolchi++;
  252.             }
  253.             else
  254.                 if (s[i] >= 'a' && s[i] <= 'z') {
  255.                     mal = 1;
  256.                 }
  257.                 else
  258.                     if (s[i] >= 'A' && s[i] <= 'Z') {
  259.                         bol = 1;
  260.                     }
  261.         }
  262.         if (prov == 0) { return s; }
  263.         else {
  264.             system("cls");
  265.             cout << "Логин: " << login << endl;
  266.             cout << "Пароль должен состоять из цифр и латинской буквы." << endl;
  267.             cout << "Введите пароль: ";
  268.         }
  269.     }
  270. }
  271.  
  272. int zapolFileAccount(Account* Acc, int n) {
  273.     fstream clr_file("registr.txt", ios::out);
  274.     clr_file.close();
  275.     ofstream fo;
  276.     fo.open("registr.txt", ios::out);
  277.     for (int i = 0; i < n; i++) {
  278.         fo << i << endl;
  279.         fo << Acc[i].log << endl;
  280.         fo << Acc[i].pas << endl;
  281.         fo << Acc[i].prava << endl;
  282.     }
  283.     fo << n << endl;
  284.     fo << Acc[n].log << endl;
  285.     fo << Acc[n].pas << endl;
  286.     fo << Acc[n].prava << endl;
  287.     fo << n + 1 << endl;
  288.     fo.close();
  289.     return 0;
  290. }
  291.  
  292. string provLogin(Account* Acc, int n1) {
  293.     cout << "Введите логин: ";
  294.     string s;
  295.     while (true) {
  296.         int prov = 0;
  297.  
  298.         getline(cin, s);
  299.         for (int i = 0; i < n1; i++) {
  300.             if (s == Acc[i].log) prov = 3;
  301.         }
  302.  
  303.         if (prov == 0) {
  304.             system("cls");
  305.             cout << "Такого логина не существует." << endl;
  306.             cout << "Введите логин: ";
  307.         }
  308.         else
  309.             if (prov == 3) { return s; }
  310.     }
  311. }
  312.  
  313. string provekraParolya(Account* Acc, int n1, string login) {
  314.     system("cls");
  315.     cout << "Логин: " << login << endl;
  316.     cout << "Введите ваш пароль: ";
  317.     string s;
  318.     int popitki = 4;
  319.     while (true) {
  320.         int check1 = 0;
  321.         s = vvodParolya();
  322.         for (int i = 0; i < n1; i++) {
  323.             if (Acc[i].log == login && Acc[i].pas == s) {
  324.                 check1 = 1;
  325.                 break;
  326.             }
  327.         }
  328.         if (check1 == 1) { system("cls"); return s; }
  329.         else {
  330.             system("cls");
  331.             cout << "Логин: " << login << endl;
  332.             cout << "Вы ввели не верный пароль. Повторите попытку. У вас еще " << popitki - 1 << " попытки(а)" << endl;
  333.             cout << "Введите пароль: ";
  334.         }
  335.         popitki--;
  336.         s = "1";
  337.         if (popitki == 0) return s;
  338.     }
  339. }
  340.  
  341. string vvodParolya() {
  342.     string s;
  343.     while (true) {
  344.         int c;
  345.         char cc;
  346.         c = _getch();
  347.         if (c == 224) {
  348.             c = _getch();
  349.         }
  350.         else
  351.             if (c == 8) {
  352.                 if (s.length() != 0) {
  353.                     cout << '\b' << " " << '\b';
  354.                     s.erase(s.length() - 1);
  355.                 }
  356.             }
  357.             else
  358.                 if (c == 13) break;
  359.                 else
  360.                     if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
  361.                         cc = (char)c;
  362.                         s = s + cc;
  363.                         cout << "*";
  364.                     }
  365.     }
  366.     return s;
  367. }
  368.  
  369. int menuAdministratora(Account* Acc, int n, string login) {
  370.     while (true) {
  371.         int mn = vivodMenuAdmin(login);
  372.         if (mn == 3) {
  373.             return 0;
  374.         }
  375.         else
  376.             if (mn == 0) {
  377.                 menuPolzovetlAdmin(Acc, n);
  378.             }
  379.             else
  380.                 if (mn == 1) {
  381.                     menuRedaktDannyh();
  382.                 }
  383.                 else {
  384.                     menuObrabDannyh("");
  385.                 }
  386.     }
  387. }
  388.  
  389. int vivodMenuAdmin(string login) {
  390.     int kol = 0, key = 0;
  391.     while (true) {
  392.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите меню" << endl;
  393.         kol = (kol + 4) % 4;
  394.         cout << "Здраствуйте админ.: " << login << "." << endl;
  395.         if (kol == 0) { cout << " -- Меню редактирования учетных записей" << endl; }
  396.         else cout << " Меню редактирования учетных записей" << endl;
  397.  
  398.         if (kol == 1) { cout << " -- Меню редактирования информации" << endl; }
  399.         else cout << " Меню редактирования информации" << endl;
  400.  
  401.         if (kol == 2) { cout << " -- Меню обработки информации" << endl; }
  402.         else { cout << " Меню обработки информации" << endl; }
  403.  
  404.         if (kol == 3) { cout << " -- Выйти в главное меню" << endl; }
  405.         else { cout << " Выйти в главное меню" << endl; }
  406.  
  407.         key = _getch();
  408.         if (key == 224) {
  409.             key = _getch();
  410.             if (key == 72) kol--;
  411.             if (key == 80) kol++;
  412.         }
  413.         if (key == 13) { system("cls"); return kol; }
  414.         system("cls");
  415.     }
  416. }
  417.  
  418. void menuPolzovetlAdmin(Account* Acc, int n) {
  419.     int key_acc;
  420.     while (true) {
  421.         key_acc = vivodMenuAccounta();
  422.         if (key_acc == 4) {
  423.             break;
  424.         }
  425.         else
  426.             if (key_acc == 0) {
  427.                 system("cls");
  428.                 vivodInfPolzovatel(Acc, n);
  429.             }
  430.             else
  431.                 if (key_acc == 1) {
  432.                     system("cls");
  433.                     Account* t = new Account[n + 1];
  434.                     copy(Acc, Acc + n, t);
  435.                     delete[]Acc;
  436.                     Acc = t;
  437.                     t = NULL;
  438.                     Acc[n].log = proverkaLogina(Acc, n);
  439.                     Acc[n].pas = provPass(Acc[n].log);
  440.                     Acc[n].prava = proverkaPravPolzovatelya();
  441.                     n = n + 1;
  442.                     system("cls");
  443.                 }
  444.                 else
  445.                     if (key_acc == 2) {
  446.                         system("cls");
  447.                         int vibr = korektAccount(Acc, n);
  448.                         if (vibr == n) continue;
  449.                         int vibr1 = viborRedaktAccount(Acc, vibr);
  450.                         if (vibr1 == 0) Acc[vibr].log = proverkaLogina(Acc, n);
  451.                         else
  452.                             if (vibr1 == 1) Acc[vibr].pas = provPass(Acc[vibr].log);
  453.                             else Acc[vibr].prava = proverkaPravPolzovatelya();
  454.                         system("cls");
  455.                     }
  456.                     else
  457.                         if (key_acc == 3) {
  458.                             int vibr = korektAccount(Acc, n);
  459.                             if (vibr == n) continue;
  460.                             cout << "Аккаунт " << Acc[vibr].log << " удалён!!!" << endl;
  461.                             for (int i = vibr; i < n - 1; i++) {
  462.                                 Acc[i] = Acc[i + 1];
  463.                             }
  464.                             n--;
  465.                             system("pause");
  466.                             system("cls");
  467.                         }
  468.     }
  469.     zapolFileAccount(Acc, n - 1);
  470. }
  471.  
  472. int vivodMenuAccounta() {
  473.     int kol = 0, key = 0;
  474.     while (true) {
  475.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите меню" << endl;
  476.         kol = (kol + 5) % 5;
  477.         if (kol == 0) { cout << " -- Просмотр учетных записей" << endl; }
  478.         else cout << " Просмотр учетных записей" << endl;
  479.  
  480.         if (kol == 1) { cout << " -- Добавление учетной записи" << endl; }
  481.         else cout << " Добавление учетной записи" << endl;
  482.  
  483.         if (kol == 2) { cout << " -- Редактирование учетных записей" << endl; }
  484.         else { cout << " Редактирование учетных записей" << endl; }
  485.  
  486.         if (kol == 3) { cout << " -- Удаление учетной записи" << endl; }
  487.         else { cout << " Удаление учетной записи" << endl; }
  488.  
  489.         if (kol == 4) { cout << " -- Выйти в меню администратора" << endl; }
  490.         else { cout << " Выйти в меню администратора" << endl; }
  491.  
  492.         key = _getch();
  493.         if (key == 224) {
  494.             key = _getch();
  495.             if (key == 72) kol--;
  496.             if (key == 80) kol++;
  497.         }
  498.         if (key == 13) { system("cls"); return kol; }
  499.         system("cls");
  500.     }
  501. }
  502.  
  503. int vivodInfPolzovatel(Account* Acc, int n) {
  504.     for (int i = 0; i < n; i++) {
  505.         cout << setw(24) << "     Пользователь №" << i + 1 << endl;
  506.         cout << " Логин: " << Acc[i].log << endl;
  507.         cout << " Пароль: " << Acc[i].pas << endl;
  508.         if (Acc[i].prava == 1)
  509.             cout << " Роль: Администратор" << endl;
  510.         else
  511.             cout << " Роль: Пользователь" << endl;
  512.     }
  513.     system("pause");
  514.     system("cls");
  515.     return 0;
  516. }
  517.  
  518. int proverkaPravPolzovatelya() {
  519.     string s;
  520.     while (true) {
  521.         system("cls");
  522.         cout << "Введите 0 - если у пользоветля будут права администратора или 1 - если у пользователя будут обычные права: ";
  523.         getline(cin, s);
  524.         system("cls");
  525.         if (s == "1") return 1;
  526.         else
  527.             if (s == "0") return 0;
  528.     }
  529. }
  530.  
  531. int korektAccount(Account* Acc, int n) {
  532.     int kol = 1, key;
  533.     while (true) {
  534.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите аккаунт " << endl;
  535.         kol = (kol + (n + 1)) % (n + 1);
  536.         for (int i = 1; i < n; i++) {
  537.             if (i == kol) { cout << " -- " << i << " - " << Acc[i].log << endl; }
  538.             else cout << " " << i << " - " << Acc[i].log << endl;
  539.         }
  540.         if (kol == n) { cout << " -- Выйти с выбора пользовтеля" << endl; }
  541.         else cout << " Выйти с выбора пользовтеля" << endl;
  542.         key = _getch();
  543.         if (key == 224) {
  544.             key = _getch();
  545.             if (key == 72) { kol--; if (kol == 0) kol = n; }
  546.             if (key == 80) { kol++; if (kol == n + 1) kol = 1; }
  547.         }
  548.         if (key == 13) { system("cls"); return kol; }
  549.         system("cls");
  550.     }
  551. }
  552.  
  553. int viborRedaktAccount(Account* Acc, int vibr) {
  554.     int kol = 0, key = 0;
  555.     while (true) {
  556.         cout << "Стрелочками ВВЕРХ и ВНИЗ выбериет меню" << endl;
  557.         kol = (kol + 3) % 3;
  558.         if (kol == 0) { cout << " -- Изменить логин: " << Acc[vibr].log << endl; }
  559.         else cout << " Изменить логин: " << Acc[vibr].log << endl;
  560.  
  561.         if (kol == 1) { cout << " -- Изменить пароль: " << Acc[vibr].pas << endl; }
  562.         else cout << " Изменить пароль: " << Acc[vibr].pas << endl;
  563.  
  564.         if (kol == 2) { cout << " -- Изменить права: " << Acc[vibr].prava << endl; }
  565.         else { cout << " Изменить права: " << Acc[vibr].prava << endl; }
  566.  
  567.         key = _getch();
  568.         if (key == 224) {
  569.             key = _getch();
  570.             if (key == 72) kol--;
  571.             if (key == 80) kol++;
  572.         }
  573.         if (key == 13) { system("cls"); return kol; }
  574.         system("cls");
  575.     }
  576. }
  577.  
  578. void menuRedaktDannyh() {
  579.     ifstream fin;
  580.     fin.open("Project.txt", ios::in);
  581.     fin.seekg(-3, ios::end);
  582.     int n = 0;
  583.     fin >> n;
  584.     fin.close();
  585.     Project* Proj = new Project[n + 1];
  586.     if (n != 0)
  587.         zapolnenieProj(Proj, n);
  588.     while (true) {
  589.         int vibr = vivodMenuRedaktInf();
  590.         if (vibr == 4) break;
  591.         else
  592.             if (vibr == 0) {
  593.                 if (n == 0) { cout << "Проектов в базе данных нет!" << endl; system("pause"); system("cls"); }
  594.                 else {
  595.                     vivodProj(Proj, n);
  596.                 }
  597.             }
  598.             else
  599.                 if (vibr == 1) {
  600.                     Project* tt = new Project[n + 2];
  601.                     copy(Proj, Proj + n, tt);
  602.                     delete[]Proj;
  603.                     Proj = tt;
  604.                     tt = NULL;
  605.                     dobavlenieProject(Proj, n);
  606.                     n++;
  607.                 }
  608.                 else
  609.                     if (vibr == 2) {
  610.                         int vibor = 0;
  611.                         int viborR = 6;
  612.                         while (true) {
  613.                             vibor = redakProj(Proj, n);
  614.                             if (vibor == n) break;
  615.                             while (true) {
  616.                                 viborR = viborRedakt(Proj, vibor);
  617.                                 if (viborR == 5) break;
  618.                                 if (viborR == 0) { cout << "Введите наименование проекта: "; Proj[vibor].name_project = vvodProj();  system("cls"); }
  619.                                 else
  620.                                     if (viborR == 1) { Proj[vibor].vid_rab = provVidaRab(); system("cls"); }
  621.                                     else
  622.                                         if (viborR == 2) { Proj[vibor].FIO = vvodFIO(); system("cls"); }
  623.                                         else
  624.                                             if (viborR == 3) {
  625.                                                 cout << "Введите количество часов: ";
  626.                                                 Proj[vibor].kolvo_chas = provStoimostChas();
  627.                                                 system("cls");
  628.                                             }
  629.                                             else
  630.                                                 if (viborR == 4) {
  631.                                                     cout << "Введите стоимость часа: ";
  632.                                                     Proj[vibor].stoimost_chas = provStoimostChas();
  633.                                                     system("cls");
  634.                                                 }
  635.                             }
  636.                         }
  637.                     }
  638.                     else
  639.                         if (vibr == 3) {
  640.                             int udal = redakProj(Proj, n);
  641.                             if (udal == n) continue;
  642.                             else {
  643.                                 for (int i = udal; i < n - 1; i++) {
  644.                                     Proj[i] = Proj[i + 1];
  645.                                 }
  646.                                 n--;
  647.                             }
  648.                         }
  649.                         else break;
  650.     }
  651.     if (n != 0) zapFileProj(Proj, n);
  652. }
  653.  
  654. void zapolnenieProj(Project* Proj, int n) {
  655.     ifstream fin;
  656.     fin.open("Project.txt", ios::in);
  657.     string s;
  658.     getline(fin, s);
  659.     for (int i = 0; i < n; i++) {
  660.         getline(fin, Proj[i].name_project);
  661.         getline(fin, Proj[i].vid_rab);
  662.         getline(fin, Proj[i].FIO);
  663.         getline(fin, Proj[i].kolvo_chas);
  664.         getline(fin, Proj[i].stoimost_chas);
  665.         getline(fin, s);
  666.     }
  667.     fin.close();
  668. }
  669.  
  670. int vivodMenuRedaktInf() {
  671.     int kol = 0, key = 0;
  672.     while (true) {
  673.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите меню" << endl;
  674.         kol = (kol + 5) % 5;
  675.         if (kol == 0) { cout << " -- Просмотр списка проектов" << endl; }
  676.         else cout << " Просмотр списка проектов" << endl;
  677.  
  678.         if (kol == 1) { cout << " -- Добавление проектов" << endl; }
  679.         else cout << " Добавление проектов" << endl;
  680.  
  681.         if (kol == 2) { cout << " -- Редактирование проектов" << endl; }
  682.         else { cout << " Редактирование проектов" << endl; }
  683.  
  684.         if (kol == 3) { cout << " -- Удаление проектов" << endl; }
  685.         else { cout << " Удаление проектов" << endl; }
  686.  
  687.         if (kol == 4) { cout << " -- Выйти в меню администратора" << endl; }
  688.         else { cout << " Выйти в меню администратора" << endl; }
  689.  
  690.         key = _getch();
  691.         if (key == 224) {
  692.             key = _getch();
  693.             if (key == 72) kol--;
  694.             if (key == 80) kol++;
  695.         }
  696.         if (key == 13) { system("cls"); return kol; }
  697.         system("cls");
  698.     }
  699. }
  700.  
  701. void vivodProj(Project* Proj, int n) {
  702.     for (int i = 0; i < n; i++) {
  703.         cout << "     Проект №" << i + 1 << endl;
  704.         cout << " Наименование проекта: " << Proj[i].name_project << endl;
  705.         cout << " Вид работ: " << Proj[i].vid_rab << endl;
  706.         cout << " Ф.И.О: " << Proj[i].FIO << endl;
  707.         cout << " Количество часов: " << Proj[i].kolvo_chas << endl;
  708.         cout << " Стоимость часа: " << Proj[i].stoimost_chas << endl;
  709.         cout << endl;
  710.         cout << endl;
  711.     }
  712.     system("pause");
  713.     system("cls");
  714. }
  715.  
  716. int dobavlenieProject(Project* Proj, int n) {
  717.     cout << "Введите наименование проекта: ";
  718.     Proj[n].name_project = vvodProj();
  719.     system("cls");
  720.     Proj[n].vid_rab = provVidaRab();
  721.     system("cls");
  722.     Proj[n].FIO = vvodFIO();
  723.     system("cls");
  724.     cout << "Введите количество часов: ";
  725.     Proj[n].kolvo_chas = provStoimostChas();
  726.     system("cls");
  727.     cout << "Введите стоимость часа: ";
  728.     Proj[n].stoimost_chas = provStoimostChas();
  729.     system("cls");
  730.     return 0;
  731. }
  732.  
  733. string vvodFIO() {
  734.     cout << "Введите имя: ";
  735.     string name = vvodProj();
  736.     cout << endl;
  737.     cout << "Введите фамилию: ";
  738.     string fam = vvodProj();
  739.     cout << endl;
  740.     cout << "Введите отчество: ";
  741.     string otch = vvodProj();
  742.     system("cls");
  743.     return fam + " " + name + " " + otch;
  744. }
  745.  
  746. string vvodProj() {
  747.     string s;
  748.     while (true) {
  749.         int c;
  750.         char cc;
  751.         c = _getch();
  752.         if (c == 224) {
  753.             c = _getch();
  754.         }
  755.         else
  756.             if (c == 8) {
  757.                 if (s.length() != 0) {
  758.                     cout << '\b' << " " << '\b';
  759.                     s.erase(s.length() - 1);
  760.                 }
  761.             }
  762.             else
  763.                 if (c == 13) {
  764.                     break;
  765.                 }
  766.                 else {
  767.                     cc = (char)c;
  768.                     if ((cc >= 'a' && cc <= 'z') || (cc >= 'A' && cc <= 'Z')) {
  769.                         s = s + cc;
  770.                         cout << cc;
  771.                     }
  772.                 }
  773.     }
  774.     return s;
  775. }
  776.  
  777. string provVidaRab() {
  778.     int kol = 0, key = 0;
  779.     string s;
  780.     while (true) {
  781.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите вид работы: " << endl;
  782.         kol = (kol + 4) % 4;
  783.  
  784.         if (kol == 0) { cout << " -- Работа над требованиями" << endl; s = "Работа над требованиями"; }
  785.         else cout << " Работа над требованиями" << endl;
  786.  
  787.         if (kol == 1) { cout << " -- Разработка архитектуры" << endl; s = "Разработка архитектуры"; }
  788.         else cout << " Разработка архитектуры" << endl;
  789.  
  790.         if (kol == 2) { cout << " -- Реализация" << endl; s = "Реализация"; }
  791.         else cout << " Реализация" << endl;
  792.  
  793.         if (kol == 3) { cout << " -- Тестирование" << endl; s = "Тестирование"; }
  794.         else { cout << " Тестирование" << endl; }
  795.  
  796.         key = _getch();
  797.         if (key == 224) {
  798.             key = _getch();
  799.             if (key == 72) kol--;
  800.             if (key == 80) kol++;
  801.         }
  802.         if (key == 13) { system("cls"); return s; }
  803.         system("cls");
  804.     }
  805. }
  806.  
  807. string provStoimostChas() {
  808.     string s;
  809.     while (true) {
  810.         int c;
  811.         char cc;
  812.         c = _getch();
  813.         if (c == 224) {
  814.             c = _getch();
  815.         }
  816.         else
  817.             if (c == 8) {
  818.                 if (s.length() != 0) {
  819.                     cout << '\b' << " " << '\b';
  820.                     s.erase(s.length() - 1);
  821.                 }
  822.             }
  823.             else
  824.                 if (c == 13) break;
  825.                 else
  826.                     if (s.length() == 8) continue;
  827.                     else
  828.                         if (c >= '0' && c <= '9') {
  829.                             cc = (char)c;
  830.                             s = s + cc;
  831.                             cout << cc;
  832.                         }
  833.     }
  834.     return s;
  835. }
  836.  
  837. int redakProj(Project* Proj, int n) {
  838.     int kol = 0, key;
  839.     while (true) {
  840.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите проект " << endl;
  841.         kol = (kol + (n + 1)) % (n + 1);
  842.         for (int i = 0; i < n; i++) {
  843.             if (i == kol) { cout << " -- " << i << " - " << Proj[i].name_project << " " << Proj[i].vid_rab << endl; }
  844.             else cout << " " << i << " - " << Proj[i].name_project << " " << Proj[i].vid_rab << endl;
  845.         }
  846.         if (kol == n) { cout << " -- Выйти с выбора проекта" << endl; }
  847.         else cout << " Выйти с выбора проекта" << endl;
  848.         key = _getch();
  849.         if (key == 224) {
  850.             key = _getch();
  851.             if (key == 72) kol--;
  852.             if (key == 80) kol++;
  853.         }
  854.         if (key == 13) { system("cls"); return kol; }
  855.         system("cls");
  856.     }
  857. }
  858.  
  859. int viborRedakt(Project* Proj, int vibr) {
  860.     int kol = 0, key = 0;
  861.     while (true) {
  862.         cout << "Стрелочками ВВЕРХ и ВНИЗ выбериет пункт редактирования" << endl;
  863.         kol = (kol + 6) % 6;
  864.         if (kol == 0) { cout << " -- Изменить наименование проекта: " << Proj[vibr].name_project << endl; }
  865.         else cout << " Изменить наименование проекта: " << Proj[vibr].name_project << endl;
  866.  
  867.         if (kol == 1) { cout << " -- Изменить вид работы: " << Proj[vibr].vid_rab << endl; }
  868.         else cout << " Изменить вид работы: " << Proj[vibr].vid_rab << endl;
  869.  
  870.         if (kol == 2) { cout << " -- Изменить Ф.И.О: " << Proj[vibr].FIO << endl; }
  871.         else { cout << " Изменить Ф.И.О: " << Proj[vibr].FIO << endl; }
  872.  
  873.         if (kol == 3) { cout << " -- Изменить кол-во часов: " << Proj[vibr].kolvo_chas << endl; }
  874.         else { cout << " Изменить кол-во часов: " << Proj[vibr].kolvo_chas << endl; }
  875.  
  876.         if (kol == 4) { cout << " -- Изменить стоимость часа: " << Proj[vibr].stoimost_chas << endl; }
  877.         else { cout << " Изменить стоимость часа: " << Proj[vibr].stoimost_chas << endl; }
  878.  
  879.         if (kol == 5) { cout << " -- Выйти к выбору проекта." << endl; }
  880.         else { cout << " Выйти к выбору проекта." << endl; }
  881.  
  882.  
  883.         key = _getch();
  884.         if (key == 224) {
  885.             key = _getch();
  886.             if (key == 72) kol--;
  887.             if (key == 80) kol++;
  888.         }
  889.         if (key == 13) { system("cls"); return kol; }
  890.         system("cls");
  891.     }
  892. }
  893.  
  894. void zapFileProj(Project* Proj, int n) {
  895.     fstream clear_file("Project.txt", ios::out);
  896.     clear_file.close();
  897.     ofstream fout;
  898.     fout.open("Project.txt", ios::out);
  899.     for (int i = 0; i < n; i++) {
  900.         fout << i << endl;
  901.         fout << Proj[i].name_project << endl;
  902.         fout << Proj[i].vid_rab << endl;
  903.         fout << Proj[i].FIO << endl;
  904.         fout << Proj[i].kolvo_chas << endl;
  905.         fout << Proj[i].stoimost_chas << endl;
  906.     }
  907.     fout << n << endl;
  908.     fout.close();
  909. }
  910.  
  911. void menuObrabDannyh(string login) {
  912.     ifstream fin;
  913.     fin.open("Project.txt", ios::in);
  914.     fin.seekg(-3, ios::end);
  915.     int n = 0;
  916.     fin >> n;
  917.     fin.close();
  918.     Project* Proj = new Project[n + 1];
  919.     if (n != 0)
  920.         zapolnenieProj(Proj, n);
  921.     else {
  922.         cout << "Проектов в базе, нет" << endl;
  923.         system("pause");
  924.         system("cls");
  925.         return;
  926.     }
  927.     while (true) {
  928.         int menu = vivodMenuObrabotki(login);
  929.         if (menu == 0) {
  930.             vivodProj(Proj, n);
  931.         }
  932.         else
  933.             if (menu == 1) {
  934.                 indvZadanie(Proj, n);
  935.             }
  936.             else
  937.                 if (menu == 2) {
  938.                     int mn = vivodMenuPoiska();
  939.                     menuPoiska(Proj, mn, n);
  940.                 }
  941.                 else
  942.                     if (menu == 3) {
  943.                         int mn = vivodMenuSort();
  944.                         menuSort(Proj, mn, n);
  945.                     }
  946.                     else {
  947.                         break;
  948.                     }
  949.     }
  950.     zapFileProj(Proj, n);
  951. }
  952.  
  953. int vivodMenuObrabotki(string s) {
  954.     int kol = 0, key = 0;
  955.     while (true) {
  956.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите пункт меню" << endl;
  957.         kol = (kol + 5) % 5;
  958.  
  959.         if (s.length() != 0) {
  960.             cout << "Здраствуйте пользователь, " << s << "!!!" << endl;
  961.         }
  962.  
  963.         if (kol == 0) { cout << " -- Просмотр информации о проектах" << endl; }
  964.         else cout << " Просмотр информации о проектах" << endl;
  965.  
  966.         if (kol == 1) { cout << " -- Индивидуальное задание" << endl; }
  967.         else cout << " Индивидуальное задание" << endl;
  968.  
  969.         if (kol == 2) { cout << " -- Поиск" << endl; }
  970.         else cout << " Поиск" << endl;
  971.  
  972.         if (kol == 3) { cout << " -- Сортировка" << endl; }
  973.         else { cout << " Сортировка" << endl; }
  974.  
  975.         if (kol == 4) { cout << " -- Выйти в меню" << endl; }
  976.         else { cout << " Выйти в меню" << endl; }
  977.  
  978.         key = _getch();
  979.         if (key == 224) {
  980.             key = _getch();
  981.             if (key == 72) kol--;
  982.             if (key == 80) kol++;
  983.         }
  984.         if (key == 13) { system("cls"); return kol; }
  985.         system("cls");
  986.     }
  987. }
  988.  
  989. int vivodMenuPoiska() {
  990.     int kol = 0, key = 0;
  991.     while (true) {
  992.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите пункт меню" << endl;
  993.         kol = (kol + 4) % 4;
  994.  
  995.         if (kol == 0) { cout << " -- Поиск по наименованию проекта" << endl; }
  996.         else cout << " Поиск по наименованию проекта" << endl;
  997.  
  998.         if (kol == 1) { cout << " -- Поиск по количеству часов" << endl; }
  999.         else cout << " Поиск по количеству часов" << endl;
  1000.  
  1001.         if (kol == 2) { cout << " -- Поиск по стоимости за час" << endl; }
  1002.         else cout << " Поиск по стоимости за час" << endl;
  1003.  
  1004.         if (kol == 3) { cout << " -- Выход в меню обработки" << endl; }
  1005.         else cout << " Выход в меню обработки" << endl;
  1006.  
  1007.  
  1008.         key = _getch();
  1009.         if (key == 224) {
  1010.             key = _getch();
  1011.             if (key == 72) kol--;
  1012.             if (key == 80) kol++;
  1013.         }
  1014.         if (key == 13) { system("cls"); return kol; }
  1015.         system("cls");
  1016.     }
  1017. }
  1018.  
  1019. void menuPoiska(Project* Proj, int mn, int n) {
  1020.     if (mn == 0) {
  1021.         cout << "Введите наименование проекта который нужно искать: ";
  1022.         string nproj = vvodProj();
  1023.         system("cls");
  1024.         int pop = 0;
  1025.         cout << endl;
  1026.         for (int i = 0; i < n; i++)
  1027.             if (Proj[i].name_project.length() >= nproj.length()) {
  1028.                 int kol = -1;
  1029.                 for (int j = 0; j < nproj.length(); j++)
  1030.                     if (nproj[j] != tolower(Proj[i].name_project[j]) && nproj[j] != toupper(Proj[i].name_project[j])) kol = 0;
  1031.                 if (kol == -1) {
  1032.                     vivodProj1(Proj, i);
  1033.                     pop++;
  1034.                 }
  1035.             }
  1036.         if (pop == 0) {
  1037.             cout << "Проектов с таким наименование, нет." << endl;
  1038.         }
  1039.         system("pause");
  1040.         system("cls");
  1041.     }
  1042.     else
  1043.         if (mn == 1) {
  1044.             cout << "Введите количество часов: ";
  1045.             string kolchas = provStoimostChas();
  1046.             system("cls");
  1047.             int pop = 0;
  1048.             for (int i = 0; i < n; i++)
  1049.                 if (kolchas == Proj[i].kolvo_chas) {
  1050.                     vivodProj1(Proj, i);
  1051.                     pop++;
  1052.                 }
  1053.             if (pop == 0) {
  1054.                 cout << "Проектов с таким количеством часов, нет." << endl;
  1055.             }
  1056.             system("pause");
  1057.             system("cls");
  1058.         }
  1059.         else
  1060.             if (mn == 2) {
  1061.                 cout << "Введите стоимость за час: ";
  1062.                 string stchas = provStoimostChas();
  1063.                 int pop = 0;
  1064.                 for (int i = 0; i < n; i++)
  1065.                     if (stchas == Proj[i].stoimost_chas) {
  1066.                         vivodProj1(Proj, i);
  1067.                         pop++;
  1068.                     }
  1069.                 if (pop == 0) cout << "Путевко с такой стоимостью за час, нет!!!" << endl;
  1070.                 system("pause");
  1071.                 system("cls");
  1072.             }
  1073. }
  1074.  
  1075. void vivodProj1(Project* Proj, int i) {
  1076.     cout << "     Проект №" << i + 1 << endl;
  1077.     cout << " Наименование проекта: " << Proj[i].name_project << endl;
  1078.     cout << " Вид работ: " << Proj[i].vid_rab << endl;
  1079.     cout << " Ф.И.О: " << Proj[i].FIO << endl;
  1080.     cout << " Количество часов: " << Proj[i].kolvo_chas << endl;
  1081.     cout << " Стоимость часа: " << Proj[i].stoimost_chas << endl;
  1082.     cout << endl;
  1083.     cout << endl;
  1084. }
  1085.  
  1086. int vivodMenuSort() {
  1087.     int kol = 0, key = 0;
  1088.     while (true) {
  1089.         cout << "Стрелочками ВВЕРХ и ВНИЗ выберите пункт меню" << endl;
  1090.         kol = (kol + 4) % 4;
  1091.  
  1092.         if (kol == 0) { cout << " -- Сортировка по возрастанию стоимости за час" << endl; }
  1093.         else cout << " Сортировка по возрастанию стоимости за час" << endl;
  1094.  
  1095.         if (kol == 1) { cout << " -- Сортировка по убыванию стоимости за час" << endl; }
  1096.         else cout << " Сортировка по убыванию стоимости за час" << endl;
  1097.  
  1098.         if (kol == 2) { cout << " -- Сортировка по возростанию кол-во часов" << endl; }
  1099.         else cout << " Сортировка по возростанию кол-во часов" << endl;
  1100.  
  1101.         if (kol == 3) { cout << " -- Сортировка по убыванию кол-во часов" << endl; }
  1102.         else { cout << " Сортировка по убыванию кол-во часов" << endl; }
  1103.  
  1104.         if (kol == 4) { cout << " -- Выйти в меню обработки" << endl; }
  1105.         else { cout << " Выйти в меню обработки" << endl; }
  1106.  
  1107.         key = _getch();
  1108.         if (key == 224) {
  1109.             key = _getch();
  1110.             if (key == 72) kol--;
  1111.             if (key == 80) kol++;
  1112.         }
  1113.         if (key == 13) { system("cls"); return kol; }
  1114.         system("cls");
  1115.     }
  1116. }
  1117.  
  1118. void menuSort(Project* Proj, int mn, int n) {
  1119.     if (mn == 0) {
  1120.         for (int i = 0; i < n; i++)
  1121.             for (int j = 0; j < n - 1; j++) {
  1122.                 int s1, s2;
  1123.                 s1 = stoi(Proj[j].stoimost_chas);
  1124.                 s2 = stoi(Proj[j + 1].stoimost_chas);
  1125.                 if (s1 > s2) {
  1126.                     Project* Mas = new Project[1];
  1127.                     Mas[0] = Proj[j];
  1128.                     Proj[j] = Proj[j + 1];
  1129.                     Proj[j + 1] = Mas[0];
  1130.                 }
  1131.             }
  1132.         cout << "Проекты отсортированы по возрастанию стоимости за час." << endl;
  1133.         system("pause");
  1134.         system("cls");
  1135.     }
  1136.     else
  1137.         if (mn == 1) {
  1138.             for (int i = 0; i < n; i++)
  1139.                 for (int j = 0; j < n - 1; j++) {
  1140.                     int s1, s2;
  1141.                     s1 = stoi(Proj[j].stoimost_chas);
  1142.                     s2 = stoi(Proj[j + 1].stoimost_chas);
  1143.                     if (s1 < s2) {
  1144.                         Project* Mas = new Project[1];
  1145.                         Mas[0] = Proj[j];
  1146.                         Proj[j] = Proj[j + 1];
  1147.                         Proj[j + 1] = Mas[0];
  1148.                     }
  1149.                 }
  1150.             cout << "Проекты отсортированы по убыванию стоимости за час." << endl;
  1151.             system("pause");
  1152.             system("cls");
  1153.         }
  1154.     if (mn == 2) {
  1155.         for (int i = 0; i < n; i++)
  1156.             for (int j = 0; j < n - 1; j++) {
  1157.                 int s1, s2;
  1158.                 s1 = stoi(Proj[j].kolvo_chas);
  1159.                 s2 = stoi(Proj[j + 1].kolvo_chas);
  1160.                 if (s1 > s2) {
  1161.                     Project* Mas = new Project[1];
  1162.                     Mas[0] = Proj[j];
  1163.                     Proj[j] = Proj[j + 1];
  1164.                     Proj[j + 1] = Mas[0];
  1165.                 }
  1166.             }
  1167.         cout << "Проекты отсортированы по возрастанию кол-во часов." << endl;
  1168.         system("pause");
  1169.         system("cls");
  1170.     }
  1171.     if (mn == 3) {
  1172.         for (int i = 0; i < n; i++)
  1173.             for (int j = 0; j < n - 1; j++) {
  1174.                 int s1, s2;
  1175.                 s1 = stoi(Proj[j].kolvo_chas);
  1176.                 s2 = stoi(Proj[j + 1].kolvo_chas);
  1177.                 if (s1 < s2) {
  1178.                     Project* Mas = new Project[1];
  1179.                     Mas[0] = Proj[j];
  1180.                     Proj[j] = Proj[j + 1];
  1181.                     Proj[j + 1] = Mas[0];
  1182.                 }
  1183.             }
  1184.         cout << "Проекты отсортированы по убыванию кол-во часов." << endl;
  1185.         system("pause");
  1186.         system("cls");
  1187.     }
  1188. }
  1189.  
  1190. void indvZadanie(Project* Proj, int n) {
  1191.     IndvZad* Mas = new IndvZad[n];
  1192.     int kol = 0;
  1193.     for (int i = 0; i < n; i++) {
  1194.         int prov = 0, tot = 0, tot1 = 0;
  1195.         for (int j = 0; j < kol; j++)
  1196.             if (prov == 0) {
  1197.                 if (Proj[i].name_project.length() == Mas[j].name_proj.length()) {
  1198.                     for (int k = 0; k < Proj[i].name_project.length(); k++) {
  1199.                         if (tolower(Proj[i].name_project[k]) == tolower(Mas[j].name_proj[k])) {
  1200.                             prov = 1;
  1201.                             tot = j;
  1202.                             break;
  1203.                         }
  1204.                     }
  1205.                 }
  1206.             }
  1207.             else break;
  1208.  
  1209.         if (prov == 0) {
  1210.             Mas[kol].name_proj = Proj[i].name_project;
  1211.             Mas[kol].kolvo_sotrud = 1;
  1212.             Mas[kol].stoimost_proekta = stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas);
  1213.             if (Proj[i].vid_rab == "Работа над требованиями") { Mas[kol].perechen_rabot[0] = 1;  Mas[kol].perechen_rabot_st[0] = (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1214.             else
  1215.                 if (Proj[i].vid_rab == "Разработка архитектуры") { Mas[kol].perechen_rabot[1] = 1; Mas[kol].perechen_rabot_st[1] = (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1216.                 else
  1217.                     if (Proj[i].vid_rab == "Реализация") { Mas[kol].perechen_rabot[2] = 1; Mas[kol].perechen_rabot_st[2] = (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1218.                     else
  1219.                         if (Proj[i].vid_rab == "Тестирование") { Mas[kol].perechen_rabot[3] = 1; Mas[kol].perechen_rabot_st[3] = (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1220.             kol++;
  1221.         }
  1222.         else {
  1223.             Mas[tot].kolvo_sotrud++;
  1224.             Mas[tot].stoimost_proekta = Mas[tot].stoimost_proekta + (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas));
  1225.             if (Proj[i].vid_rab == "Работа над требованиями") { Mas[tot].perechen_rabot[0] = 1; Mas[tot].perechen_rabot_st[0] = Mas[tot].perechen_rabot_st[0] + (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1226.             else
  1227.                 if (Proj[i].vid_rab == "Разработка архитектуры") { Mas[tot].perechen_rabot[1] = 1; Mas[tot].perechen_rabot_st[1] = Mas[tot].perechen_rabot_st[1] + (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1228.                 else
  1229.                     if (Proj[i].vid_rab == "Реализация") { Mas[tot].perechen_rabot[2] = 1; Mas[tot].perechen_rabot_st[2] = Mas[tot].perechen_rabot_st[2] + (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1230.                     else
  1231.                         if (Proj[i].vid_rab == "Тестирование") { Mas[tot].perechen_rabot[3] = 1; Mas[tot].perechen_rabot_st[3] = Mas[tot].perechen_rabot_st[3] + (stoi(Proj[i].stoimost_chas) * stoi(Proj[i].kolvo_chas)); }
  1232.         }
  1233.     }
  1234.  
  1235.     for (int i = 0; i < kol; i++) {
  1236.         cout << " Проект: " << Mas[i].name_proj << endl;
  1237.         cout << " Стоимость проекта: " << Mas[i].stoimost_proekta << "руб." << endl;
  1238.         cout << " Сотрудников: " << Mas[i].kolvo_sotrud << endl;
  1239.         cout << " Виды работ: " << endl;
  1240.         if (Mas[i].perechen_rabot[0] == 1) cout << "     Работа над требованиями - " << Mas[i].perechen_rabot_st[0] << "руб." << endl;
  1241.         if (Mas[i].perechen_rabot[1] == 1) cout << "     Разработка архитектуры - " << Mas[i].perechen_rabot_st[1] << "руб." << endl;
  1242.         if (Mas[i].perechen_rabot[2] == 1) cout << "     Реализация - " << Mas[i].perechen_rabot_st[2] << "руб." << endl;
  1243.         if (Mas[i].perechen_rabot[3] == 1) cout << "     Тестирование - " << Mas[i].perechen_rabot_st[3] << "руб." << endl;
  1244.         cout << endl;
  1245.         cout << endl;
  1246.     }
  1247.     system("pause");
  1248.     system("cls");
  1249. }
Add Comment
Please, Sign In to add comment