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 1354. Palindrome. Again Palindrome

Why WA. Need help
Posted by ShipilinSergey 3 Apr 2005 03:41
var S:string;
    i,j:integer;
    A,B:longint;
begin
     readln(s);
     A:=0;
     B:=0;
     j:=length(s) div 2;
     if odd(length(s)) then inc(j);
     for i:=1 to j do
     begin
        A:=A+Ord(s[i]);
     end;
     for i:=length(s) downto j do
     begin
        B:=B+Ord(s[i]);
     end;

     if a<>b then
     begin
      for i:=length(s)-1 downto 1 do
      begin
         s:=s+s[i];
      end;
      writeln(s);
     end else Writeln(s);
end.
Re: Why WA. Need help
Posted by ShipilinSergey 3 Apr 2005 03:45
OOOH. I found my error