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 WA. Please help ME.
Posted by I am david. Tabo. 5 Nov 2002 21:01
var i,j,k,l,m,n:integer;
    a,sol:array [0..101] of string;
    b:array [0..101] of integer;
    sintacs,word_st:string;
    ch1,ch2:char;

function swap(s:string):string;
var nn,mm,ww:integer;
    aa,bb:char;
    s1:string;
  begin
    nn:=length(s);
    ww:=nn;s1:='';
    for mm:=nn downto 1 do
      s1:=s1+s[mm];
    word_st:=s1;
  end;

procedure sort;
  begin
    for i:=1 to m do
      begin
        a[i]:=a[i]+' ';
        inc (b[i]);
      end;
  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;
  sort;
  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]<>'.')and(j<>b[i]) 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.
Re: Whi WA. Please help ME.
Posted by Anton Savin 5 Nov 2002 21:13
>         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]<>'.')and(j<>b[i]) then

There are much more different characters.
Try that one:
if ((a[i][j] < 'a') or (a[i][j] > 'z')) and
   ((a[i][j] < 'A') or (a[i][j] > 'Z')) then
...
THENCK YOU. I WILL TRY IT.
Posted by I am david. Tabo. 6 Nov 2002 09:10
> >         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]<>'.')and(j<>b[i]) then
>
> There are much more different characters.
> Try that one:
> if ((a[i][j] < 'a') or (a[i][j] > 'z')) and
>    ((a[i][j] < 'A') or (a[i][j] > 'Z')) then
> ...