program TinhTongVaUocSo;
var
a, b, tong, i: integer;
laSoNguyenTo: boolean;
begin
write('Nhap a: ');
readln(a);
write('Nhap b: ');
readln(b);
tong := a + b;
writeln('Tong cua a va b la: ', tong);
writeln('Uoc so cua tong la:');
for i := 1 to tong do
begin
if tong mod i = 0 then
writeln(i);
end;
laSoNguyenTo := true;
if tong < 2 then
laSoNguyenTo := false
else
for i := 2 to trunc(sqrt(tong)) do
if tong mod i = 0 then
begin
laSoNguyenTo := false;
break;
end;
if laSoNguyenTo then
writeln('Tong a va b la so nguyen to')
else
writeln('Tong a va b khong phai la so nguyen to');
readln;
end.