What's wrong with my program?
var i,n,m:byte;st:string;
procedure main;
begin m:=1;readln(st);
repeat
if copy(st,1,3)='one'then delete(st,1,3)else
if copy(st,1,5)='puton'then delete(st,1,5)else
if (copy(st,1,7)='inputon')then delete(st,1,7)else
if (copy(st,1,8)='outputon')then delete(st,1,8)else
if (copy(st,1,2)='in')and(st[3]<>'p')then delete(st,1,2)else
if (copy(st,1,3)='out')and(st[4]<>'p')then delete(st,1,3)else
if (copy(st,1,5)='input')and(copy(st,6,2)<>'on')then delete
(st,1,5)else
if (copy(st,1,6)='output')and(copy(st,7,2)<>'on')then delete
(st,1,6)else
begin m:=0;break;end;
until st='';
end;
begin readln(n);
for i:=1 to n do
begin
main;
if m=1 then writeln('YES')else writeln('No');
end;
end.
Re: What's wrong with my program?
Послано
VALERO 12 сен 2006 03:02
Try this : inputone
Total length of all strings is no more then 10^7 characters.
Don't read by string
Edited by author 12.09.2006 03:07