- 1 名前:デフォルトの名無しさん mailto:sage [2005/11/23(水) 23:31:08 ]
- Delphi初心者が問題をコツコツと解きながらレベルアップするためのスレです。
- 85 名前:デフォルトの名無しさん mailto:sage [2005/12/20(火) 06:50:34 ]
- >>78-80
function CountAlphaWord(const str: AnsiString): Integer; var i: Integer; cnt: Integer; isAlphaNow: Boolean; isAlphaPrev: Boolean; begin isAlphaPrev:=False; cnt:=0; i:=1; while (i <= Length(str)) do begin isAlphaNow:=False; if ( (str[i] in LeadBytes)) then begin Inc(i,2); end else begin if (str[i] in ['a'..'z', 'A'..'Z']) then begin isAlphaNow:=True; end; Inc(i); end;
- 86 名前:デフォルトの名無しさん mailto:sage [2005/12/20(火) 06:54:35 ]
- if (not isAlphaPrev) and isAlphaNow then
begin Inc(cnt); end; isAlphaPrev:=isAlphaNow; end; result:=cnt; end; //ここまで よろしくお願いします
|

|