-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenaNA.cpp
More file actions
129 lines (101 loc) · 2.32 KB
/
Copy pathGenaNA.cpp
File metadata and controls
129 lines (101 loc) · 2.32 KB
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
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
#include <stdio.h>
#include <iostream>
#include <locale>
#include <windows.h>
#include <ctime>
#include <vector>
#include <deque>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]){
setlocale(LC_ALL, "Russian");
SetConsoleOutputCP(1251);
SetConsoleCP(1251);
system("color 70" );
//Перки
int zagad, mass, aq, zagadP = 0;
bool zapros;
char nn;
//Скок символов
char pchar[67] = {
'0',
'1', '2', '3',
'4', '5', '6',
'7', '8', '9',
'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p',
'q', 'r', 's', 't',
'u', 'v', 'w', 'x',
'y', 'z',
'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X',
'Y', 'Z',
'_', '$', '!', '?', '&'
};
vector<char> password;
srand(time(NULL));
while(true){
cout << "Если хотите начать генерировать пароль, то нажмите 1\nЕсли нет, то 0" << endl;
cin >> zapros;
system("cls");
if (zapros == 1){
cout << "Сколько символов будет в пароле: ";
cin >> zagad;
zagadP = zagad;
system("cls");
while (zagad != 0){
if(zagad > 247) {
int qwe = rand();
srand(qwe);
int q = rand();
srand(q);
aq = q + pow(zagad, 1);
srand(aq);
aq = rand();
srand(aq);
int wasd = rand();
srand(wasd);
}
else{
int qwe = rand();
srand(qwe);
int q = rand();
srand(q);
aq = q + pow(zagad, 3);
srand(aq);
aq = rand();
srand(aq);
}
mass = rand() % 62;
nn = pchar[mass];
password.push_back(nn);
zagad--;
}
cout << "====================================================================================" << endl;
for (int i = 0; i < zagadP; i++) {
cout << password[i];
}
cout << endl << "====================================================================================" << endl;
cout << "Чтобы сделать ещё один пароль нажмите Enter" << endl;
system("PAUSE");
password.clear();
system("cls");
}
else{break;}
}
system("PAUSE");
return 0;
}