Var a: array of integer; var i: byte; var b: boolean; begin b: =true; setlength(a,8); var n: =0; writeln('введите число: '); readln(i); var d: =i; while i< > 0 do begin a[n]: =i mod 2; i: =i div 2; inc(n); end; setlength(a,n); for i: =0 to n-1 do begin if n=0 then begin write(0); break; end; swap(a[i],a[n-1]); write(a[i]); end; for i: =1 to n-1 do begin if n=0 then break; if a[i-1]< > a[i] then begin b: =false; break; end; end; if (b=false) then write(' = ',d,' это не палиндром') else write(' = ',d,' это палиндром'); end.
Function prime(x:integer):boolean; var t:boolean; d:integer; begin t := true; d := 2; while t and (d*d <= x) do begin if x mod d = 0 then t := false; d := d + 1 end; prime := t end;
function order(x:integer):boolean; var t:boolean; d:integer; begin d := -1; repeat t := x mod 10 > d; d := x mod 10; x := x div 10 until not t or (x = 0); order := t end;
var t:boolean; i,k,n:integer; begin t := false; read(k,n); for i := k to n do if prime(i) then if order(i) then begin write(i,' '); t := true end; if not t then write(0) end.
var
t:boolean;
d:integer;
begin
t := true;
d := 2;
while t and (d*d <= x) do
begin
if x mod d = 0 then
t := false;
d := d + 1
end;
prime := t
end;
function order(x:integer):boolean;
var
t:boolean;
d:integer;
begin
d := -1;
repeat
t := x mod 10 > d;
d := x mod 10;
x := x div 10
until not t or (x = 0);
order := t
end;
var
t:boolean;
i,k,n:integer;
begin
t := false;
read(k,n);
for i := k to n do
if prime(i) then
if order(i) then
begin
write(i,' ');
t := true
end;
if not t then
write(0)
end.