Вниз
Скачать: CL | DM;

Алгоритм перебора символов.   Найти похожие ветки 

← →
Nikfel ©   (2007-06-22 16:42) [0]

Пожалуйста подскажите. Как лудше сделать перебор символов. Вот мой вариант, но может есть по короче и быстрее.
var
 ttkd:string;
 nmp:integer;
 strTURNSL:array[1..999999] of string;

function dwsaq(strq:string):string;
var intX,intY:integer;
strF:string;
begin
intX:=length(strq);
for intY:=1 to intX do
begin
strF:=strF+strTURNSL[nmp];
end;
if strF=strq then begin
strF:="";
for intY:=1 to intX+1 do
begin
strF:=strF+strTURNSL[1];
end;
result:=strF;
end else result:=strq;
end;

function trueWT(strS:string;i:integer):boolean;
var intD:integer;
begin
for intD:=1 to nmp-1 do
begin
if copy(strS,i,1)=strTURNSL[intD] then
begin
ttkd:=copy(strS,1,i-1)+strTURNSL[intD+1]
+copy(strS,i+1,length(strS));
result:=true;
end;
end;
if copy(strS,i,1)=strTURNSL[nmp] then
begin
ttkd:=copy(strS,1,i-1)+strTURNSL[1]
+copy(strS,i+1,length(strS));
result:=false;
end;
end;

function startf(strNS:string):string;
var hndg:integer;
begin
ttkd:=strNS;
ttkd:=dwsaq(ttkd);
if strNS<>ttkd then
begin
result:=ttkd;
exit;
end;
hndg:=length(ttkd);
while hndg>0 do
begin
if trueWT(ttkd,hndg) then
begin
result:=ttkd;
exit;
end else hndg:=hndg-1;
end;
end;

procedure TForm1.KOLForm1FormCreate(Sender: PObj);
var  F: TextFile;
S,strS: string;
intI:integer;
begin
AssignFile(F,"111.TXT");\\файл с набором символов
Reset(F);
while Not EOF(F) do
begin
Readln(F, S);
strS:=StrS+S;
end;
CloseFile(F);
nmp:=length(StrS);
for intI:=1 to nmp do
begin
strTURNSL[intI]:=copy(strS,intI,1);
end;
end;

procedure TForm1.Button1Click(Sender: PObj);
begin
EditBox1.Text:=startf(EditBox1.Text);
end;

Как можно проверить пароль к архиву rar и zip, подходит он или нет.


← →
AndreyRus   (2007-06-22 17:37) [1]

А причем здесь KOL!


← →
ANTPro ©   (2007-06-22 20:21) [2]

> [0] Nikfel ©   (22.06.07 16:42)

Скачай лучше программу для подбора пароля и не майся фигней



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
8-1161287385
Skopas
2006-10-19 23:49
2008.01.13
Поиск в BMP


4-1182150503
Dimaxx
2007-06-18 11:08
2008.01.13
Внутренняя конфигурация HDD


2-1197386963
mufan
2007-12-11 18:29
2008.01.13
TRichEdit: блокировка Ctrl+C (ненужное копирование)


9-1165444400
EkZot
2006-12-07 01:33
2008.01.13
Вращения гланого героя вокруг своей оси.


9-1164555344
Тёма
2006-11-26 18:35
2008.01.13
Размытие текстуры в GLScene




   Наверх