Lời giải :
program hotrotinhoc;
var a,b : integer;
function NT(n: integer) : boolean;
var i : integer;
begin
if x<2 then exit(false);
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then exit(false);
exit(true);
end;
begin
write('Nhap so dau tien :'); readln(a);
write('Nhap so thu hai :'); readln(b);
if nt(a) and nt(b) and (b-a=2) then write('Day la cap so sinh doi') else write('Day khong phai la cap so sinh doi');
readln
end.