Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MakeDict(aList: TStringList): IIntArray;
- var
- i: Integer;
- str: string;
- DoCount: INteger;
- begin
- Result := CreateArray;
- DoCount := 0;
- for i := 0 to aList.Count - 1 do
- begin
- str := aList[i];
- if str = 'do' then
- Inc(DoCount);
- if Result.Exist(str) then
- begin
- Result[str] := Result[str] + 1;
- end
- else
- begin
- Result[str] := 1;
- end;
- end;
- if (DoCount > 0) then
- Result['while'] := Result['while'] - DoCount;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement