输入一个长度1500以下的文件,输出文件中字母的总数,空格的总数及所有数字的和。 pascal

[复制链接]
查看11 | 回复2 | 2012-8-6 11:32:44 | 显示全部楼层 |阅读模式
本题最好的解法:var s:ansistring;
i,t1,t2,t3:integer;beginreadln(s);for i:=1 to length(s) do
begin
if ((sin['a'..'z'])or(sin['A'..'Z'])) then inc(t1);
if s=' ' then inc(t2);
if sin['0'..'9'] then inc(t3,ord(s)-48);
end;writeln(t1,' ',t2,' ',t3);end....
回复

使用道具 举报

千问 | 2012-8-6 11:32:44 | 显示全部楼层
program wenjian(input,output);var letter,blank,total:integer;
ch:char;begin
assign(input,'input.in');
assign(output,'output.out');
reset(input);
rewr...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行