program pagr; uses g_modulis; var l, kiek, c, i, p,i1, a_search : integer; rez, stat : string; mas : masyvas; f, outf, st : text; start,start1,Result: longint; begin {$I-} Assign(f, 'BLA.txt'); Rewrite(f); for i := 1 to 2000 do begin randomize; mas[i] := random(1000); write(f, mas[i], ' '); end; reset(f); kiek :=0; repeat Writeln(' Enter the result file name: '); Readln(rez); Assign(outf, rez); Rewrite(outf); Inc(kiek); if kiek=3 then halt; until IOResult=0; kiek :=0; repeat Writeln('Enter the statistics file name: '); Readln(stat); Assign(st, stat); Rewrite(st); Inc(kiek); if kiek=3 then halt; until IOResult=0; {$I+} p := 1; while not seekeof(f) do begin if seekeoln(f) then readln(f); read(f, l); mas[p] := l; inc(p); end; writeln('First massive'); for i1 :=1 to 2000 do write(mas[i1],' '); writeln; start:=gettime1; burbulas(mas , n); writeln('Time of sorting:',gettime1-start, ' mSec'); write(st, gettime1-start ); for c := 1 to 2000 do begin write(outf, mas[c]); write(outf,' '); write(mas[c],' '); end; writeln; Writeln(' Enter the value of element to find:'); Readln(a_search); start1:=gettime1; Result:=Bin_Search (mas, 50, a_search); if (result > 0) then begin WriteLn('Time of finding ', GetTime1 - start1); writeln ('number= ',result) ; end else writeln('Not found!'); readln; close(f); close(st); close(outf); readln; end.