|
|
вернуться в форумWhy I WA for the text one?But i have passed the example text? 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? Послано yzlhm 31 дек 2009 10:44 lwysb |
|
|