Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project_d_permut;
- {$APPTYPE CONSOLE}
- uses
- System.SysUtils,
- System.Diagnostics,
- Next_perm_string in 'Next_perm_string.pas';
- var
- s : AnsiString;
- i, len : integer;
- StopWatch : TStopwatch;
- begin
- s := 'abcdef'; //ghijkl';
- len := length(s)+1;
- i := 0;
- StopWatch := StopWatch.StartNew;
- repeat begin
- if (i<6) then writeln( s ); //comment out for performance
- inc(i);
- end
- until not D_next_permutation(s, 1, len ) ;
- StopWatch.Stop;
- writeln;
- writeln( 'Delphi ', i );
- writeln( 'Seconds: ', StopWatch.elapsedMilliSeconds/1000:2:3 );
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement