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

Whi ACCES VIOLATION. when i send it on online contest i got Ac.
Posted by I am david. Tabo. 4 Nov 2002 18:49
var i,j,k,l,m,n:integer;
    a,sol:array [1..100] of string;
    b:array [1..100] of integer;
    sintacs,word_st:string;
    ch1,ch2:char;

function swap(s:string):string;
var nn,mm,ww:integer;
    aa,bb:char;
  begin
    nn:=length(s);
    ww:=nn;
    for mm:=1 to (nn div 2) do
      begin
        bb:=s[mm];
        s[mm]:=s[ww];
        s[ww]:=bb;
        dec(ww);
      end;
    word_st:=s;
  end;

begin
  while not (eof) do
    begin
      inc (m);
      while not (eoln) do
        begin
          read (ch1);
          a[m]:=a[m]+ch1;
          inc (b[m]);
        end;
      readln;
    end;
  for i:=1 to m do
    begin
    for j:=1 to b[i] do
      begin
        inc (k);
   if (a[i][j]<>' ')and(a[i][j]<>',')and(a[i][j]<>'!')and(a[i][j]
<>'?')and(a[i][j]<>'"')and(a[i][j]<>':')and(a[i][j]<>'.') then
        word_st:=word_st+a[i][j]
    else
      begin
        if word_st<>'' then
          swap(word_st);
        sol[i]:=sol[i]+word_st+a[i][j];
        word_st:='';
      end;
      end;
    writeln (sol[i]);
  end;
end.