送佛送上西,以下代码是决对正确的,给满分!procedure TForm1.Button2Click(Sender: TObject);varCharacter,i:integer;Str:string;begini:=1;Character:=0;//Str:=Memo1.lines.text;Str:=Memo1.text;If Length(Str)>0 ThenRepeatif(ord(Str)>=129) and (ord(Str)<=254 )and (ord(Str[i+1])>=64) and (ord(Str[i+1])<=254)then //这个关键是将全角符号等非汉字也除去.楼主要给满分啦!Begin If (ord(Str)>=161) and (ord(Str)<=169) Then i:=i+2 Else Begin i:=i+2; Character:=Character+1; end;endElsei:=i+1;Until i>=length(Str);showmessage('共有'+IntToStr(Character)+'个汉字');end;这佛送的,都已到送到天堂了,不给分结贴说不过去.