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 1226. esreveR redrO

help me!!!
Posted by Cezar Mocan 9 Feb 2006 14:29
Where is the mistake in my program?
I got WA on test 7

var litere:string;
    afis,s,x:array[1..260000]of char;
    i,j,k,nr,af:longint;
begin
  for i:=65 to 90 do litere:=litere+chr(i);
  for i:=97 to 122 do litere:=litere+chr(i);
  while not eof do begin
    inc(nr);
    read(s[nr]);
  end;
  i:=1;
  while i<nr do begin
    while (pos(s[i],litere)=0)and(i<=nr) do begin inc(af);afis[af]:=s[i];inc(i);end;
    j:=i;
    while (pos(s[i],litere)<>0)and(i<=nr) do inc(i);
    for k:=i-1 downto j do begin
      inc(af);
      afis[af]:=s[k];
    end;
  end;
  for i:=1 to af do write(afis[i]);
end.