daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Dec 15th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.   a : string;
  3.   i, j, size : longint;
  4.   f : boolean;
  5. function p(fpos, size : longint; a: string) : boolean;
  6. var
  7.   b : string;
  8.   n : longint;
  9. begin
  10.   b := '';
  11.   p := False;
  12.   for n := length(a) downto 1 do
  13.     b := b + a[n];
  14.   if a = b then
  15.     p := True;
  16. end;
  17. begin
  18.   f := False;
  19.   readln(a);
  20.   for i := 1 to length(a) - 1 do
  21.     for j := 2 to length(a) - i + 1 do
  22.       if p(i, j, a) = True then
  23.         f := True;
  24.   if f then
  25.     writeln('YES')
  26.   else
  27.     writeln('NO');
  28. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top