ahu

博客园 首页 新随笔 联系 订阅 管理

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
   label
   1;
 var ch:char;
     num1,num2:integer;
  begin
   1:  num1:=0;
     num2:=0;
     writeln('以?号结束');
     read(ch);
     write(ch);
     while ch<>'?' do
     begin
     if (ch>='A') and (ch<='z')
     then num1:=num1+1
     else if (ch>='0') and (ch<='9')
      then num2:=num2+1;
     read(ch);
     write(ch)
     end;
     writeln;
      writeln('number of letter:',num1);
       writeln('number of digit:',num2);
    goto 1;
end.

posted on 2008-11-26 19:21  成虎  阅读(191)  评论(0)    收藏  举报