1 program nazwy(input,output,names,result,fhash);
\r
2 (* program czyta ciag identyfikatorow z pliku names *)
\r
3 (* na plik result wypisuje pary (nazwa, numer z hash'u ) *)
\r
4 (* na plik fhash wypisuje ciag podstawien tworzacy zmodyfikowana tablice hash *)
\r
6 type tname = array[1..10] of integer;
\r
7 thash = array[1..8000] of integer;
\r
11 a1,b1,i,j,n:integer;
\r
13 names,fhash,result:text;
\r
15 function search(vars k:integer; vars name:tname; vars hash:thash;
\r
16 vars nlast:integer):integer [fortran];extern;
\r
17 procedure init(vars hash:thash) [fortran];extern;
\r
19 (* inicjalizacja *)
\r
23 for i := 1 to 8000 do hash[i] := 0;
\r
25 (* inicjalizacja tablicy hash *)
\r
27 writeln(' koniec inicjalizacji tablicy hash ');
\r
29 while not eof(names) do
\r
34 while not eoln(names) do
\r
39 if a<'a'then a1 := ord(a) - ord('0') else
\r
40 a1 := ord(a) - ord('a')+10;
\r
41 if not eoln(names) then
\r
47 if b<'a' then b1 := ord(b) - ord('0') else
\r
48 b1 := ord(b) - ord('a')+10;
\r
49 if a1 = 0 then a1 := 60;
\r
50 name[i] := a1*64+b1;
\r
58 n := search(i,name,hash,nlast);
\r
60 writeln(result,' ',str, ' ',n);
\r
64 (* wypisanie tablicy hash *)
\r
65 for i := 1 to 8000 do
\r
67 if hash[i] <> 0 then
\r
68 writeln(fhash,' ','HASH (',i:6,' ) =',hash[i]:6);
\r