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 1094. E-screen

Why I WA for the text one?But i have passed the example text?
Posted by zslwyuan 31 Dec 2009 10:31
var
 s:array[1..100010] of char;
 i,j,k,l,now,lo:longint;
 a,t1,t2:string;
begin
 a:='';
 for i:=1 to 80 do a:=a+' ';
 i:=0;
 while not(eof) do begin inc(i);read(s[i]); end;
 lo:=i;
 now:=1;
 for i:=1 to lo do
  begin
   if (s[i]='<') then  begin dec(now); if (now=0) then now:=1; continue; end;
   if (s[i]='>') then  begin inc(now); if (now=81) then now:=1; continue; end;
   if now=1 then t1:='' else t1:=copy(a,1,now-1);
   if now=80 then t2:='' else t2:=copy(a,now+1,80-now-1);
   a:=''; a:=t1+s[i]+t2;
   t1:=''; t2:='';
   inc(now); if (now=81)then now:=1;
  end;
  for i:=1 to 80 do write(a[i]);
end.
Re: Why I WA for the text one?But i have passed the example text?
Posted by yzlhm 31 Dec 2009 10:44
lwysb