- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
#include<iostream>
#include<clocale>
#include<fstream>
#include<cstring>
using namespace std;
int main()
{
setlocale(LC_ALL,"RUS");
int cnt=0,cnt2=0,cnt3=0,cnt4=0;
int iMax=93;
bool bPassword=1;
char password[6];
char cBuffer[5]="";
char cSymbols[]=",<.>/?;:'|[{]}`~!@#$%^&*()-_=/№0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHILKLMNOPQRSTUVWXYZ";
char cClear[]="";
cout<<"Введите пароль:";
cin>>password;
cout<<"Брать ли в перебор символы?(1 - да , 0 - нет):";
bool bSymbols;
cin>>bSymbols;
cout<<"Брать ли в перебор цифры?(1 - да , 0 - нет):";
bool bNumbers;
cin>>bNumbers;
cout<<"Брать ли в перебор буквы нижнего регистра?(1 - да , 0 - нет):";
bool bDownRegister;
cin>>bDownRegister;
cout<<"Брать ли в перебор буквы верхнего регистра?(1 - да , 0 - нет):";
bool bUpRegister;
cin>>bUpRegister;
while(bPassword)
{
if(!bSymbols){if(cnt>=0&&cnt<31){cnt++;continue;}}
if(!bNumbers){if(cnt>=31&&cnt<41){cnt++;continue;}}
if(!bDownRegister){if(cnt>=31&&cnt<67){cnt++;continue;}}
if(!bUpRegister){if(cnt>=67&&cnt<iMax){cnt++;continue;}}
cBuffer[0]={cSymbols[cnt]};
bPassword=strcmp(password,cBuffer);
cout<<"cBuffer:"<<cBuffer<<endl;
if(bPassword){strcpy(cBuffer,cClear);}
if(cnt==iMax)
{
cnt=0;
while(bPassword)
{
if(!bSymbols){if(cnt>=0&&cnt<31){cnt++;continue;}}
if(!bNumbers){if(cnt>=31&&cnt<41){cnt++;continue;}}
if(!bDownRegister){if(cnt>=31&&cnt<67){cnt++;continue;}}
if(!bUpRegister){if(cnt>=67&&cnt<iMax){cnt++;continue;}}
if(!bSymbols){if(cnt2>=0&&cnt2<31){cnt2++;continue;}}
if(!bNumbers){if(cnt2>=31&&cnt2<41){cnt2++;continue;}}
if(!bDownRegister){if(cnt2>=31&&cnt2<67){cnt2++;continue;}}
if(!bUpRegister){if(cnt2>=67&&cnt2<iMax){cnt2++;continue;}}
cBuffer[0]={cSymbols[cnt2]};
cBuffer[1]={cSymbols[cnt]};
bPassword=strcmp(password,cBuffer);
cout<<"cBuffer:"<<cBuffer<<endl;
if(bPassword){strcpy(cBuffer,cClear);}
if(cnt2==iMax&&cnt==iMax)
{
cnt2=0;
cnt=0;
while(bPassword)
{
if(!bSymbols){if(cnt>=0&&cnt<31){cnt++;continue;}}
if(!bNumbers){if(cnt>=31&&cnt<41){cnt++;continue;}}
if(!bDownRegister){if(cnt>=31&&cnt<67){cnt++;continue;}}
if(!bUpRegister){if(cnt>=67&&cnt<iMax){cnt++;continue;}}
if(!bSymbols){if(cnt2>=0&&cnt2<31){cnt2++;continue;}}
if(!bNumbers){if(cnt2>=31&&cnt2<41){cnt2++;continue;}}
if(!bDownRegister){if(cnt2>=31&&cnt2<67){cnt2++;continue;}}
if(!bUpRegister){if(cnt2>=67&&cnt2<iMax){cnt2++;continue;}}
if(!bSymbols){if(cnt3>=0&&cnt3<31){cnt3++;continue;}}
if(!bNumbers){if(cnt3>=31&&cnt3<41){cnt3++;continue;}}
if(!bDownRegister){if(cnt3>=31&&cnt3<67){cnt3++;continue;}}
if(!bUpRegister){if(cnt3>=67&&cnt3<iMax){cnt3++;continue;}}
cBuffer[0]={cSymbols[cnt3]};
cBuffer[1]={cSymbols[cnt2]};
cBuffer[2]={cSymbols[cnt]};
bPassword=strcmp(password,cBuffer);
cout<<"cBuffer:"<<cBuffer<<endl;
if(bPassword){strcpy(cBuffer,cClear);}
if(cnt3>=iMax&&cnt2>=iMax&&cnt>=iMax)
{
cnt3=0;
cnt2=0;
cnt=0;
while(bPassword)
{
if(!bSymbols){if(cnt>=0&&cnt<31){cnt++;continue;}}
if(!bNumbers){if(cnt>=31&&cnt<41){cnt++;continue;}}
if(!bDownRegister){if(cnt>=31&&cnt<67){cnt++;continue;}}
if(!bUpRegister){if(cnt>=67&&cnt<iMax){cnt++;continue;}}
if(!bSymbols){if(cnt2>=0&&cnt2<31){cnt2++;continue;}}
if(!bNumbers){if(cnt2>=31&&cnt2<41){cnt2++;continue;}}
if(!bDownRegister){if(cnt2>=31&&cnt2<67){cnt2++;continue;}}
if(!bUpRegister){if(cnt2>=67&&cnt2<iMax){cnt2++;continue;}}
if(!bSymbols){if(cnt3>=0&&cnt3<31){cnt3++;continue;}}
if(!bNumbers){if(cnt3>=31&&cnt3<41){cnt3++;continue;}}
if(!bDownRegister){if(cnt3>=31&&cnt3<67){cnt3++;continue;}}
if(!bUpRegister){if(cnt3>=67&&cnt3<iMax){cnt3++;continue;}}