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