pascal 高手来 集合

[复制链接]
查看11 | 回复4 | 2011-1-25 21:03:30 | 显示全部楼层 |阅读模式
(lx184.pas)输入一个大写字母字符串,找出未在此串中出现的所有大写字母。
输入一串字符 以!感叹号结束
看不懂啊

回复

使用道具 举报

千问 | 2011-1-25 21:03:30 | 显示全部楼层
var a:char;i:integer;c:array['A'..'Z']of boolean;beginfillchar(c,sizeof(c),0);//清空数组repeat
read(a);
if a='!' then break;
c[a]:=true;until false;for i:=ord('A') to ord('Z') do if c[chr(i)]=false then write(chr(i):5);end. //如果编译失败请改一改,本电脑没有Free Pascal,敬请谅解。
回复

使用道具 举报

千问 | 2011-1-25 21:03:30 | 显示全部楼层
这很水的。
本菜鸟帮你吧。
字符串s
a:array['A'..'Z'] of boolean;
fillchar(a,sizeof(a),true);
for i:=1 to length(s) do

回复

使用道具 举报

千问 | 2011-1-25 21:03:30 | 显示全部楼层
program a;vara:char;beginwhile a='!' dobegin
read(a);
if (asc(a)=90) then
write(a);end;end. 楼上的好像效率不高啊
回复

使用道具 举报

千问 | 2011-1-25 21:03:30 | 显示全部楼层
菜鸟群来了:program a;vara:char;beginwhile a='!' dobegin
read(a);
if (asc(a)=90) then
write(a);end;end.
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行