PersonalCorpus 版 (精华区)

153735 08:46:46 4 Mar 2002
Bozhang,HIT,P.R.China 1038 Pascal Accepted 0.02 sec 49K


var
    f1,f2:boolean;
    c:char;
    res:integer;
begin
    f1:=true; f2:=true; res:=0;
    while not eof(input) do begin
        if eoln(input) then begin f2:=true;c:=' '; readln end else read(c);
        case c of
            '.','!','?' : begin f1:=true; f2:=true; end;
            'A'..'Z'    : begin
                              if f1 then f1:=false;
                              if f2 then f2:=false else inc(res);
                          end;
            'a'..'z'    : begin
                              if f1 then inc(res);
                              if f1 then f1:=false;
                              if f2 then f2:=false;
                          end;
        else
            f2:=true;
        end;
    end;
    writeln(res);
end.
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.543毫秒