procedure TForm1.Button1Click(Sender: Tobject);
var  s:string;
   I,e,c:integer;
begin
   s:=memo1.text;
   e:=0;
   c:=0;
   for I:=1 to length(s) do
   begin
      if (ord(s[I])>=33)and(ord(s[I])<=126) then
      begin
         inc(e);
         label1.caption:='英文字数:'+inttostr(e);
      end
      else if (ord(s[I])>=127) then
      begin
         inc(c);
         label2.caption:='中文字数:'+inttostr(c div 2);
      end;
   end;
end;