uses crt; var a:longint; {—Ham-xet—} function chia_het(a:longint):longint; begin if (a mod 3=0) and (a mod 5=0) then write(a,’ chia het cho 3 & 5′) else write(a,’ khong chia het cho 3 va 5′); end; {—Chuong-trinh-chinh—} BEGIN clrscr; write(‘Nhap so nguyen: ‘); readln(a); chia_het(a); readln; END.
program chia_het;
uses crt;
var a:integer;
begin
clrscr;
write(‘Nhap a: ‘); readln(a);
if (a mod 3=0) and (a mod 5=0) then write(‘Co’)
else write(‘Khong’);
readln;
end.
uses crt;
var a:longint;
{—Ham-xet—}
function chia_het(a:longint):longint;
begin
if (a mod 3=0) and (a mod 5=0) then write(a,’ chia het cho 3 & 5′)
else write(a,’ khong chia het cho 3 va 5′);
end;
{—Chuong-trinh-chinh—}
BEGIN
clrscr;
write(‘Nhap so nguyen: ‘); readln(a);
chia_het(a);
readln;
END.