Code:
function KontrolaJMBG(s: string): Boolean;
var
a: array[2..14] of integer;
iKont, iZbroj, i: integer;
begin
for i := 2 to 14 do
a[i] := StrToInt( s[i - 1] );
for i := 1 to 6 do
begin
iKont := (8 - i) * (a[i + 1] + a[i + 7]);
iZbroj := iZbroj + iKont;
end;
iZbroj := 11 - (iZbroj mod 11);
Result := (iZbroj = a[14]);
end;
function KontrolaJMBG(s: string): Boolean;
var
a: array[2..14] of integer;
iKont, iZbroj, i: integer;
begin
for i := 2 to 14 do
a[i] := StrToInt( s[i - 1] );
for i := 1 to 6 do
begin
iKont := (8 - i) * (a[i + 1] + a[i + 7]);
iZbroj := iZbroj + iKont;
end;
iZbroj := 11 - (iZbroj mod 11);
Result := (iZbroj = a[14]);
end;
F