Pascal编程问题(送分题)

来源:百度知道 编辑:UC知道 时间:2024/05/19 22:41:57
Pascal编程问题
帮帮忙
http://hi.baidu.com/pascal%B3%F5%D1%A7%D5%DF/album/item/83e5f77f6294561929388a65.html
答好了还有60分!
http://zhidao.baidu.com/question/49199463.html
谢谢!!!!
7点半以前答出还有分!

已经发到你的邮箱了

1.var a,b,i,:integer; (a为字母个数,b为数字个数)
c:char;
begin
a:=0;
b:=0;
while c <> ‘?’ do
begin
read(c);
i:=ord(c);
if (i>=48) and (i<=57)then b:=b+1;
if (i>=65) and (i<=90) then a:=a+1;
if (i>=97) and (i<=122) then a:=a+1;
end;
writeln(a,b);
readln;
end;

var
a,b:integer; (a=字母数,b=数字数)
c:char;
begin
a:=0;
b:=0;
while c <> ‘?’ do
begin
read(c);
if (c>='0') and (i<='9')
then
b:=b+1;
if (i>='A') and (i<='Z')
then
a:=a+1;
if (i>='a') and (i<='z')
then
a:=a+1;
end;
writeln(a,b);
readln;
end.