Jater

Kristina_while

Dec 6th, 2012
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {c)Найдите целые числа,
  2. которые при возведении в квадрат дают палиндромы,
  3. например, 26 = 676.}
  4.  
  5. var
  6.     x,y,z,d,f:integer;
  7. begin
  8.     for x:=1 to 99 do
  9.     begin
  10.         y:=x*x;
  11.         if (y<1000) then
  12.         begin
  13.             d:=y mod 10;
  14.             while(y>0)do
  15.             begin
  16.                 f:=y mod 10;
  17.                 y:=y div 10;
  18.             end;
  19.             if(d=f) then write(x,'=',x*x,'; ');
  20.         end
  21.         else
  22.         begin
  23.             d:=y mod 10;
  24.             z:=(y div 10)mod 10;
  25.             f:=(y div 100)mod 10;
  26.             y:=y div 1000;
  27.             if((d=y) and (z=f)) then write(x,'=',x*x,'; ');
  28.         end;
  29.     end;
  30.     readln;
  31. End.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×