var a,b:longint;
function ktnt(x:longint):boolean;
var i:longint;
begin
if x<2 then exit(false);
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then exit(false);
exit(true);
end;
function ktdx(x:longint):boolean;
var i:longint;
s:string;
begin
str(x,s);
for i:=1 to length(s) div 2 do
if s[i]<>s[length(s)-i+1] then exit(false);
exit(true);
end;
procedure xuli;
var i,d:longint;
begin
readln(a,b);d:=0;
For i:=a to b do
If (ktnt(i)=true) and (ktdx(i)=true) then inc(d);
Writeln(d);
end;
begin
assign(input,'daugia.inp');reset(input);
assign(output,'daugia.out');rewrite(output);
xuli;
Close(input);Close(output);
end.
* Chuyên dạy lập trình ONLINE cho học sinh THCS, THPT *.
Mọi giao lưu, trao đổi, xin liên hệ: Lê Quang Vinh - zalo: 037.803.8755.
Page: Lớp học Code Sky
Group FB1: Ôn thi HSG9 - THTB - TS10 chuyên tin
Group FB2: Học Scratch - Ôn thi Tin học trẻ bảng A
Thứ Tư, 27 tháng 4, 2022
DAUGIA Pascal
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét
Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.