- 分享
- 2009-08-02 16:37:31 @
大家帮帮忙
Program P1482;
var
n, i : longint;
Procedure work;
var
s, us, as : string;
ch : char;
p, dp : longint;
begin
randomize;
readln(s);
us := s;
p := 0;
while (p = 0) and (us '') do
begin
ch := us[1];
delete(us, 1, 1);
p := pos(ch, us);
end;
if us = '' then
begin
writeln('safe');
exit;
end;
as := copy(us, 1, p-1);
dp := p;
p := 0;
while (p = 0) and (as '') do
begin
ch := as[1];
delete(as, 1, 1);
p := pos(ch, as);
end;
if p > 0 then
begin
writeln('de1ete');
exit;
end;
delete(us, 1, dp);
p := 0;
while (p = 0) and (us '') do
begin
ch := us[1];
delete(us, 1, 1);
p := pos(ch, us);
end;
if us = '' then writeln('safe') else writeln('de1ete');
end;
begin
readln(n);
for i := 1 to n do work;
end.
这是程序。。。
大家看看。。
错最后一个点
管一下~(≧▽≦)/~啦啦啦