ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1102. Strange Dialog

What's wrong with my program?
Posted by netpioneers 28 May 2002 23:23
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?
Posted by VALERO 12 Sep 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