Форум программистов, компьютерный форум, киберфорум
С++ для начинающих
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
0 / 0 / 0
Регистрация: 15.11.2017
Сообщений: 39
1

Как всегда оставлять минимум 1 админа.И создать хеширование паролей

10.05.2019, 11:57. Показов 273. Ответов 0

Author24 — интернет-сервис помощи студентам
Нужно что бы всегда оставался 1 администратор.И сделать рабочую функцию хеширования.
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
#include "pch.h"
#include <iostream>
#include <string>
#include <fstream>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#include <iomanip>
 
using namespace std;
const int SIZE_OF_ACCOUNTS = 500;
string const FILE_OF_ACCOUNTS = "C://Users/Philipp/source/repos/Kursach/Accounts.txt";
const int SIZE_ARR_OF_INFOTMATION = 500;
const string FILE_OF_INFORMATION = "C://Users/Philipp/source/repos/Kursach/Information.txt";// ПУТЬ К ФАЙЛУ
 
 
struct Account
{
    string login;
    string pass;
    int role; //0-пользователь,1-администратор
};
struct Information
{
    string fio;
    string tarif;
    string nomer;
    int godpodkluchenija;
};
struct by_name
{
    char ch;
    by_name(char c) : ch(c) {} // конструктор, инициализирует ch значением, которое мы передаем при вызове by_name(name)
    bool operator()(const Information& inf) // оператор вызова с семантикой функции, т.е. obj(arg);
    {
        return //возвращаем true
            inf.fio.size() && // если строка не пустая
            tolower(inf.fio.front()) == tolower(ch);    // и первый символ равен тому что мы передали в конструктор
                                                        // приведя их к нижнему регистру с помощью tolower
    }
};
struct by_god {
    int god; 
    by_god(int& n) : god(n) {}
    bool operator()( Information& inf) {
        return
            god == inf.godpodkluchenija;
    }
 
};
struct by_nomer
{
    string nomer;
    by_nomer(const string& n) : nomer(n) {}
    bool operator()(const Information& inf) { 
        return 
            tolower(nomer == inf.nomer); }
};
 
struct by_tarif
{
    string tarif;
    by_tarif(const string& t) : tarif(t) {}
    bool operator()(const Information& inf) {
        return
        tolower(tarif == inf.tarif); }
};
template<class Pred>
void PoiskPanel(Information *arr_of_Information, int num_of_Information, Pred p) {
    int count = 0;
    for (int i = 0; i < num_of_Information; ++i)
        if (tolower(p(arr_of_Information[i])))
        {
            cout << i + 1 << "." << setw(8) << arr_of_Information[i].fio << "\t\t   " << setw(10)
                << arr_of_Information[i].nomer << "\t  " << setw(10)
                << arr_of_Information[i].tarif << "\t\t " << setw(10) << arr_of_Information[i].godpodkluchenija << endl;
            count++;
        }cout << "Результатов поиска :" << count << endl;
};
bool by_name1(const Information& lh, const Information& rh) { return lh.fio > rh.fio; }
bool by_group(const Information& lh, const Information& rh) { return lh.godpodkluchenija > rh.godpodkluchenija; }
bool by_nm_gr(const Information& lh, const Information& rh) {
    return
        by_name1(lh, rh) ||
        ((lh.fio == rh.fio) == 0 && by_group(lh, rh));
}
//...и т.д.
template<typename ARR,typename NUM >
void Deletefunction(ARR *arr_of_Information, NUM &num_of_Information)//Шаблон бахнуть
{
    cout << "Введите номер удаляемой записи ";
    int del_item;
    cin >> del_item;
    for (int i = del_item - 1; i < num_of_Information; i++)
        arr_of_Information[i] = arr_of_Information[i + 1];
    num_of_Information--;
    system("cls");
    cout << "запись удалена !" << endl;
    cout << endl;
 
}
template<class Foo>
void my_sort(Information *s, int n, Foo f)
{
    Information t;
    for (int i = 0; i < n - 1; i++)
    {
        for (int g = i + 1; g < n; g++)
        {
            if (f(s[i], s[g]))
            {
                t = s[i];
                s[i] = s[g];
                s[g] = t;
            }
        }
    }
};
 
void showAccounts(const Account *arr_of_accounts, const int i)
{
    cout << setw(14) << left << (i + 1) <<
        setw(14) << arr_of_accounts->login <<
        setw(14) << arr_of_accounts->pass <<
        setw(14) << arr_of_accounts->role << endl;
}
 
void ShowInformation(const Information *p_information, const int i)
{
    cout << (i + 1) << "." << setw(8) << p_information->fio << "\t\t   " << setw(10)
        << p_information->nomer << "\t  " << setw(10)
        << p_information->tarif << "\t\t " << setw(10) << p_information->godpodkluchenija << endl;
}
template<typename T> 
void showTable(const T *arr, const int num_of_el, void(*p_PrintFunct)(const T*, const int), const char *header_str)
{
    cout << header_str;
    for (int i = 0; i < num_of_el; i++)
        (*p_PrintFunct)(arr + i, i);
}
unsigned int JSHash(const string& str)
{
    unsigned int hash = 1315423911;
 
    for (std::size_t i = 0; i < str.length(); i++)
    {
        hash ^= ((hash << 5) + str[i] + (hash >> 2));
    }
 
    return (hash & 0x7FFFFFFF);
}
void UserPanel(Information *arr_of_Information, int &num_of_Information);
void authorization(Account *arr_of_accounts, int &number_of_accounts, Information *arr_of_Information, int &num_of_Information);
void readFileAccounts(Account *arr_of_accounts, int &number_of_accounts);
string check_unique_login(Account *arr_of_accounts, int &number_of_accounts);
void readFileInformation(Information *arr_of_information, int &number_of_information);
void menuInformation(Account *arr_of_accounts, int number_of_accounts, Information *arr_of_Information, int &num_of_Information);
void addAdmin(Account *arr_of_accounts, int &number_of_accounts);
void AddInformation(Information *arr_of_Information, int &num_of_Information);
void AdminPanel(Account *arr_of_accounts, int number_of_accounts, Information *arr_of_Information, int &num_of_Information);
void addUser(Account *arr_of_accounts, int &number_of_accounts);
void boostAccounts(Account *arr_of_accounts, int number_of_accounts);
void writeEndFileAccounts(Account new_account);
void writeEndFileInformation(Information svegak);
void boostInformation(Information *arr_of_Information, int num_of_Information);
string check_unique_login(Account *arr_of_accounts, int &number_of_accounts);
string Vvodparol();
int main(){
    SetConsoleCP(1251);
    SetConsoleOutputCP(1251);
    Account arr_of_accounts[SIZE_OF_ACCOUNTS];
    int number_of_accounts = 0;
    Information arr_of_Information[SIZE_ARR_OF_INFOTMATION];
    int num_of_Information = 0;//addAdmin(arr_of_accounts, number_of_accounts); 
    //addAccounts(arr_of_accounts, number_of_accounts);
    authorization(arr_of_accounts,number_of_accounts, arr_of_Information, num_of_Information);
    
}
void readFileAccounts(Account *arr_of_accounts, int &number_of_accounts)
{
    ifstream fin(FILE_OF_ACCOUNTS, ios::in); //Открыли файл для чтения
    if (!fin.is_open()) cout << "Указанный файл не существует!" << endl;
    else
    {
        int i = 0;
        while (!fin.eof())
        {
            fin >> arr_of_accounts[i].login
                >> arr_of_accounts[i].pass
                >>arr_of_accounts[i].role;
            i++;
        }
        number_of_accounts = i;
    }
    fin.close(); //Закрыли открытый файл
}
void readFileInformation(Information *arr_of_information, int &number_of_information)
{
    ifstream fin(FILE_OF_INFORMATION, ios::in); //Открыли файл для чтения
    if (!fin.is_open()) cout << "Указанный файл не существует!" << endl;
    else
    {
        int i = 0;
        while (!fin.eof())
        {
            fin >> arr_of_information[i].fio
                >> arr_of_information[i].nomer
                >> arr_of_information[i].tarif
                >>arr_of_information[i].godpodkluchenija;
            i++;
        }
        number_of_information = i;
    }
    fin.close(); //Закрыли открытый файл
}void authorization(Account *arr_of_accounts, int &number_of_accounts, Information *arr_of_Information, int &num_of_Information)
{
    readFileAccounts(arr_of_accounts, number_of_accounts);
    readFileInformation(arr_of_Information, num_of_Information);
    system("cls");
    string newlogin, newpass; int i = 0;
    cout << "____________________________________________АВТОРИЗАЦИЯ____________________________________________\n";
    cout << "Введите логин: " << endl;
    cin >> newlogin;
    for (i; i < number_of_accounts; i++)
    {
        if (newlogin == arr_of_accounts[i].login) {
            newpass=Vvodparol(); cout << endl;
            //cin >> newpass;
            if (newpass == arr_of_accounts[i].pass)
            {
                cout << "\n____________________________________________ДОБРО ПОЖАЛОВАТЬ В СИСТЕМУ____________________________________________ \n" << endl;
                if(0==(arr_of_accounts[i].role) )
                {
                    cout << "Вы вошли как пользователь" << endl;
                    cout << "____________________________________________МЕНЮ ДЛЯ РАБОТЫ ПОЛЬЗОВАТЕЛЯ____________________________________________\n " << endl;
                    UserPanel( arr_of_Information, num_of_Information);
                    break;
                }
                else {
                    cout << "Вы вошли как администратор" << endl;
                    cout << "____________________________________________МЕНЮ ДЛЯ РАБОТЫ АДМИНИСТРАТОРА____________________________________________\n " << endl;
                    AdminPanel(arr_of_accounts, number_of_accounts, arr_of_Information, num_of_Information);
                    break;
                }
                
            }
            else { cout << "Вы ввели неверный пароль!\n"; }break;
        }
 
    }
}
 string Vvodparol() {
     string pass;
    cout << "Введите пароль пользователя(английскими буквами и цифрами): \n" << endl;
    int ch = 0;               // Переменная для символа.
    while (true)                // Создание бесконечного цикла.
    {
        ch = _getch();        // Помещаем код нажатой клавиши в переменную.
        if (ch == 13)         // Установка Enter на прерывание цикла.
        {
            break;         // Прерывание цикла.
        }
        if (ch == 27)   // Установка Esc на закрытие консоли.
        {
            exit(0);      // Выход из консоли.
        }
        if (ch == 8)     // Установка Backspace на удаление символов.
        {
 
            cout << (char)8 << ' ' << char(8);
            /*Смещение курсора на одну позицию  в лево вывод пробела и
            снова смещение курсора влево, то есть при нажатии Backspace
            символ будет стираться, а курсор перемещаеться. */
 
            if (!pass.empty())
                /*Если строка pass не являеться пустой, то из неё
                можно удалять  последний символ (Иначе закрывалась консоль.)*/
 
                pass.erase(pass.length() - 1);
            // позволяет удалить последний символ из строки pass
        }
 
        else
        {
            cout << '*';            // Замена символов на *
            pass += (char)ch;       // Преврашение кода из целого числа в символ.
        }
    }return pass;
}
 void AdminPanel(Account *arr_of_accounts, int number_of_accounts, Information *arr_of_Information, int &num_of_Information)
 {
 
     int var_vvoda, menu, var;
     while (true) {
         cout << "1 - МЕНЮ ДЛЯ РАБОТЫ С УЧЕТНЫМИ ЗАПИСЯМИ ПОЛЬЗОВАТЕЛЕЙ" << endl;
         cout << "2 - МЕНЯ ДЛЯ РАБОТЫ С  ДАННЫМИ" << endl;
         cin >> menu;
         if (menu == 1)
         {
             system("cls");
             cout << "1 - ПРОСМОТРЕТЬ ВСЕ УЧЕТНЫЕ ЗАПИСИ" << endl;
             cout << "2 - ДОБАВИТЬ УЧЕТНУЮ ЗАПИСЬ" << endl;
             cout << "3 - УДАЛИТЬ УЧЕТНУЮ ЗАПИСЬ" << endl;
             cout << "4 - РЕДАКТИРОВАТЬ УЧЕТНУЮ ЗАПИСЬ" << endl;
             cout << "5 - ВЫХОД В МЕНЮ АДМИНИСТРАТОРА" << endl;
             cout << "0 - ВЫХОД ИЗ СИСТЕМЫ" << endl;
             cout << endl;
             cin>>var_vvoda;
             switch (var_vvoda)
             {
             case 1:showTable(arr_of_accounts, number_of_accounts,showAccounts, "ТАБЛИЦА УЧЕТНЫХ ЗАПИСЕЙ ПОЛЬЗОВАТЕЛЕЙ"); continue;
             case 2:
                 cout << "Добавить аккаунт администратора-1,пользователя-любая цифра\n";
                 cin>>var;
                 if (var == 1)  addAdmin(arr_of_accounts, number_of_accounts);
                else addUser(arr_of_accounts, number_of_accounts);
                 continue;
             case 3:showTable(arr_of_accounts, number_of_accounts, showAccounts, "ТАБЛИЦА УЧЕТНЫХ ЗАПИСЕЙ ПОЛЬЗОВАТЕЛЕЙ");
                Deletefunction(arr_of_accounts, number_of_accounts); continue;
            case 4:boostAccounts(arr_of_accounts, number_of_accounts); continue;
             case 5:AdminPanel(arr_of_accounts, number_of_accounts, arr_of_Information, num_of_Information); continue;
             case 0:exit(0);
             }
         }
         if (menu == 2)menuInformation(arr_of_accounts, number_of_accounts, arr_of_Information, num_of_Information);
     }
 }
 void boostAccounts(Account *arr_of_accounts, int number_of_accounts)
 {
     showTable(arr_of_accounts, number_of_accounts, showAccounts, "ТАБЛИЦА УЧЕТНЫХ ЗАПИСЕЙ ПОЛЬЗОВАТЕЛЕЙ");
     cout << "Введите номер редактируемой записи ";
     int upd_item;
     cin >> upd_item;
     cout << "отредактируейте данные учётной записи: " << endl;
     cout << "логин: !";
     cin >> arr_of_accounts[upd_item - 1].login;
     cout << "Пароль: !";
     cin >> arr_of_accounts[upd_item - 1].pass;
     cout << "роль: !";
     cin >> arr_of_accounts[upd_item - 1].role;
     system("cls");
     cout << "запись отредактирована !" << endl;
     cout << endl;
 }
 void addAdmin(Account *arr_of_accounts, int &number_of_accounts)
 {
     if (number_of_accounts + 1 < SIZE_OF_ACCOUNTS)
     {
         number_of_accounts++;
         arr_of_accounts[number_of_accounts - 1].role = 1;
         cout << "Введите логин администратора: \n";
         arr_of_accounts[number_of_accounts - 1].login = check_unique_login(arr_of_accounts, number_of_accounts);
         arr_of_accounts[number_of_accounts - 1].pass=Vvodparol();
         writeEndFileAccounts(arr_of_accounts[number_of_accounts - 1]);
         system("cls");
         cout << "Аккаунт администратора успешно создан!) \n";
     }
     else { cout << "ОШИБКА!!Вся память занята! \n"; }
 }
 string check_unique_login(Account *arr_of_accounts, int &number_of_accounts)
 {
     string login;
     cin >> login;
     for (int i = 0; i < number_of_accounts; i++)
     {
         if (login == arr_of_accounts[i].login) {
             do {
                 cout << "Такой  логин  уже существует!Введите другой!" << endl;
                 cin >> login;
             } while (login == arr_of_accounts[i].login);
         }
         else break;
     }
     return login;
 }
 void writeEndFileAccounts(Account new_account)
 {
     ofstream fadd(FILE_OF_ACCOUNTS, ios::app); //Открыли файл для дозаписи
     fadd << endl;
     fadd << new_account.login << "   "
         << new_account.pass << "    "
         << new_account.role;
     fadd.close();
 }
 void addUser(Account *arr_of_accounts, int &number_of_accounts)
 {
     if (number_of_accounts + 1 < SIZE_OF_ACCOUNTS)
     {
         number_of_accounts++;
         arr_of_accounts[number_of_accounts - 1].role = 0;
         cout << "Введите логин пользователя: \n";
         arr_of_accounts[number_of_accounts - 1].login = check_unique_login(arr_of_accounts, number_of_accounts);
        arr_of_accounts[number_of_accounts - 1].pass=Vvodparol();
         writeEndFileAccounts(arr_of_accounts[number_of_accounts - 1]);
         system("cls");
         cout << "Аккаунт пользователя успешно создан!) \n";
     }
     else { cout << "ОШИБКА!!Вся память занята!" << endl; }
 }
 
 void menuInformation(Account *arr_of_accounts, int number_of_accounts, Information *arr_of_Information, int &num_of_Information) {
     cout << "Меню для работы с абонентами сотовой связи";
     cout << "1 - ПОКАЗАТЬ" << endl;
     cout << "2 - ДОБАВИТЬ" << endl;
     cout << "3 - УДАЛИТЬ" << endl;
     cout << "4 - РЕДАКТИРОВАТЬ" << endl;
     cout << "5 - ВЫХОД" << endl;
     int vibor;
     cin >> vibor;
     switch (vibor) {
     case 1: showTable(arr_of_Information, num_of_Information, ShowInformation, "|        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n");
         break;
     case 2: AddInformation(arr_of_Information, num_of_Information);
         break;
     case 3:showTable(arr_of_Information, num_of_Information, ShowInformation, "|        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n");
         Deletefunction(arr_of_Information, num_of_Information);
         break;
     case 4: boostInformation(arr_of_Information, num_of_Information);
         break;
     }
}
 /*void showAccounts(Account *arr_of_accounts, int number_of_accounts) {
     cout << "____________________________________________ТАБЛИЦА УЧЕТНЫХ ЗАПИСЕЙ ПОЛЬЗОВАТЕЛЕЙ____________________________________________\n";
     cout << "-НОМЕР---------ЛОГИН---------ПАРОЛЬ--------РОЛЬ-" << endl;
     for (int i = 0; i < number_of_accounts; i++) {
         cout << setw(14) << left << i + 1 <<
             setw(14) << arr_of_accounts[i].login <<
             setw(14) << arr_of_accounts[i].pass <<
             setw(14) << arr_of_accounts[i].role << endl;
     }
 }
 void ShowInformation(Information *arr_of_Information, int &num_of_Information) {
     cout << " |        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n";
     for (int i = 0; i < num_of_Information; i++) 
         cout << i + 1 << "."<< setw(8) << arr_of_Information[i].fio << "\t\t   " << setw(10)
         << arr_of_Information[i].nomer << "\t  " << setw(10)
         << arr_of_Information[i].tarif << "\t\t " << setw(10) << arr_of_Information[i].godpodkluchenija<< endl;
 }*/
 void AddInformation(Information *arr_of_Information, int &num_of_Information)
 {
     if (num_of_Information + 1 <= SIZE_ARR_OF_INFOTMATION) {
         num_of_Information++;
         cout << "ВВЕДИТЕ ДАННЫЕ ДЛЯ НОВОГО СОТРУДНИКА" << endl;
         cout << "ФИО: ";
         cin >> arr_of_Information[num_of_Information - 1].fio;
         cout << "Hoмер: ";
         cin >> arr_of_Information[num_of_Information - 1].nomer;
         cout << "Тариф: ";
         cin >> arr_of_Information[num_of_Information - 1].tarif;
         cout << "Год подключения: ";
         cin >> arr_of_Information[num_of_Information - 1].godpodkluchenija;
         writeEndFileInformation(arr_of_Information[num_of_Information - 1]);
         cout << "НОВЫЙ АБОНЕНТ ДОБАВЛЕН!!!" << endl;
         cout << endl;
     }
 }
void writeEndFileInformation(Information svegak) {
         ofstream fadd(FILE_OF_INFORMATION, ios::app); //Открыли файл для дозаписи
         fadd << endl;
         fadd << svegak.fio << "   "
             << svegak.nomer << "    "
             << svegak.tarif << "   "
             << svegak.godpodkluchenija << "   ";
         fadd.close();
     } 
 
 
void boostInformation(Information *arr_of_Information, int num_of_Information) {
    showTable(arr_of_Information, num_of_Information, ShowInformation, "|        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n"); 
    cout << "Введите номер редактируемой записи ";
    int upd_item;
    cin >> upd_item;
    cout << "отредактируейте данные учётной записи: " << endl;
    cout << "Что хотите редактировать?" << endl;
    cout << "1-ФИО\n2-Номер\n3-Тариф\n4-Год подключения" << endl;
    int vibor;
    cin >> vibor;
    switch (vibor) {
    case 1: cout << "ФИО: !";
        cin >> arr_of_Information[upd_item - 1].fio;
        break;
    case 2: cout << "Номер: !";
        cin >> arr_of_Information[upd_item - 1].nomer;
        break;
    case 3: cout << "Тариф: !";
        cin >> arr_of_Information[upd_item - 1].tarif;
        break;
    case 4:cout << "Год подключения: !";
        cin >> arr_of_Information[upd_item - 1].godpodkluchenija;
        break;
    }
        system("cls");
        cout << "запись отредактирована !" << endl;
        cout << endl;
    
}
void UserPanel(Information *arr_of_Information, int &num_of_Information)
{
    while (true) {
        cout << "1 - ПРОСМОТРЕТЬ ВСЕ ДАННЫЕ" << endl;
        cout << "2 - ВЫПОЛНЕНИЕ ИНДИВИДУАЛЬНОГО ЗАДАНИЯ" << endl;
        cout << "3 - ПОИСК ДАННЫХ" << endl;
        cout << "4 - СОРТИРОВКА ДАННЫХ" << endl;
        cout << "0 - ВЫХОД ИЗ СИСТЕМЫ" << endl;
        cout << endl;
        int item;
        cin >> item;
        switch (item)
        {
        case 1: showTable(arr_of_Information, num_of_Information, ShowInformation, "|        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n");
            continue;
        case 2:
            int god;
            cin >> god;
            PoiskPanel(arr_of_Information, num_of_Information, by_god(god));
            continue;
        case 3: {
            cout << "По фамилии-1 По номеру-2 По тарифу-3" << endl;
            int var;    string poisknomer;
            cin >> var;
            switch (var) {
            case 1:cout << "Введите фамилию для поиска:" << endl;
                char poisk;
                cin >> poisk;
                PoiskPanel(arr_of_Information, num_of_Information, by_name(poisk));
                break;
            case 2:
                cout << "Введите номер для поиска:" << endl;
 
                cin >> poisknomer;
                PoiskPanel(arr_of_Information, num_of_Information, by_nomer(poisknomer));
                break;
            case 3:cout << "Введите тариф для поиска:" << endl;
                string poisktarif;
                cin >> poisktarif;
                PoiskPanel(arr_of_Information, num_of_Information, by_tarif(poisktarif));
                break;
            }}
 
                continue;
        case 4: my_sort(arr_of_Information, num_of_Information, by_name1);
            //my_sort(arr_of_Information, num_of_Information, by_group);
            //my_sort(arr_of_Information, num_of_Information, by_nm_gr);
            showTable(arr_of_Information, num_of_Information, ShowInformation, "|        ФИО       |  |      Номер        |   |       Тариф        |   |      Год подключения     | \n");
            continue;
        case 0: return;
        }
    }
}
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
10.05.2019, 11:57
Ответы с готовыми решениями:

Как изменить хеширование паролей?
1)Как хешируются пароли в WP 2)Как изменить хеширование?

Хеширование паролей: какой алгоритм предпочтительней
Делаю модуль логинизации. Пароли хочу хешировать с помощью System.Security.Cryptography. Через...

Хеширование паролей. Генераторы случайных чисел
1. Изучить алгоритмы хеширования паролей. 2. Изучить известные алгоритмы работы генераторов...

Оставлять CommandButton всегда в видимости на рабочем листе при прокрутке
Доброго времени суток всем! Кто нибудь знает как реализовать такое, чтобы при скроллинге рабочего...

0
10.05.2019, 11:57
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
10.05.2019, 11:57
Помогаю со студенческими работами здесь

Создать генератор паролей в котором можно указать длину пароля и количество паролей
Помогите пожалуйста! Задание: Нужно создать генератор паролей в котором можно указать длину пароля...

Как создать впечатление эффективного админа?)
Есть вот такое дело. Обычные люди не знают ведь, по каким критериям оценивать админа, поэтому надо...

Как создать логин только для админа?
Впервые столкнулся с друпал. На сайте не предусмотрены пользователию. Как мне правильно сделать...

Как создать точку доступа Wi-Fi без прав админа?
Доброго времени суток, на работе стоит моноблок Acer на нем установлены права администратора,...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
1
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru