⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ac1038.pas

📁 uralcode
💻 PAS
字号:
program ural1038;
var
  c:char;
  sen,wor:boolean;
  mis:integer;
function cap(c:char):boolean;
  begin
    if (c>='A') and (c<='Z') then cap:=true else cap:=false;
  end;
function small(c:char):boolean;
  begin
    if (c>='a') and (c<='z') then small:=true else small:=false;
  end;
begin
  sen:=false;wor:=false;mis:=0;
  repeat
    read(c);
    if c<' ' then begin
      wor:=false;
      continue;
    end;
    if (not sen) and small(c) then inc(mis);
    if wor and cap(c) then inc(mis);
    if (c='.') or (c='!') or (c='?') then
      sen:=false
    else if cap(c) or small(c) then
      sen:=true;
    if cap(c) or small(c) then wor:=true else wor:=false;
  until eof;
  writeln(mis);
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -