虚 虚雷 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-20 #1 假设有一字符串str 怎样判断str里面至少有3个以上的字符'a'(包括3个) 谢谢! 在线等待!!急!
G Greenspan Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-20 #3 function IsYourNeed(const str:string):boolean; var i:Integer; iaNum:Integer; begin iaNum:=0; Result := false; for i:=1 to Length(str)do begin if str='a' then iaNum:=iaNum+1; if iaNum = 3 then begin Result := true; Exit; end; end; end;
function IsYourNeed(const str:string):boolean; var i:Integer; iaNum:Integer; begin iaNum:=0; Result := false; for i:=1 to Length(str)do begin if str='a' then iaNum:=iaNum+1; if iaNum = 3 then begin Result := true; Exit; end; end; end;