Mistři v programování na #hovnokod

Delphi #620

function find7(S:string):integer;
var
MyArray : TStringList;
n,i,sum, Resultat : integer;
MyInt : String;
begin
MyArray := TStringList.Create;
Trim(S); n:= 0;
while(Length(s)>0) do begin
Trim(S);
if(Pos(' ',S)=0) then begin
MyArray.Insert(n,Copy(S,1,Length(S)));
break;
end else begin
  if(Copy(S,1,Pos(' ',S))=' ') then begin
  Delete(S,1,(Pos(' ',S)));
  end else begin
    MyArray.Insert(n,Copy(S,1,Pos(' ',S)));
    Delete(S,1,(Pos(' ',S)));
    n:=n+1;
    end;
end;
end;
  Resultat := 0;
  for i := 0 to MyArray.Count-1 do begin
    MyInt := MyArray.Strings[i]; Sum := 0;
    for n := 1 to Length(MyInt) do begin
      if(MyInt[n]='7') then Sum := Sum + 1;
    end;
    if(Sum>=2) then Resultat := Resultat + 1;
  end;
  Result := Resultat;
end;

HovnoKod,