*Chia hết cho cả 3 và 5
uses crt;
var a:longint;
function chiahet(a:longint):boolean;
begin
if a mod 3<>0 then exit(false);
if a mod 5<>0 then exit(false);
exit(true);
end;
begin
clrscr;
readln(a);
if chiahet(a)=true then writeln(a,' chia het cho 3 va 5')
else writeln(a,' khong chia het cho ca 3 va 5');
readln;
end.
====================================
*Chia hết cho 3 hoặc 5
uses crt;
var a:longint;
function chiahet3(a:longint):boolean;
begin
if a mod 3<>0 then exit(false);
exit(true);
end;
function chiahet5(a:longint):boolean;
begin
if a mod 5<>0 then exit(false);
exit(true);
end;
begin
clrscr;
readln(a);
if chiahet3(a)=true then writeln(a,' chia het cho 3')
else writeln(a,' khong chia het cho 3');
if chiahet5(a)=true then writeln(a,' chia het cho 5')
else writeln(a,' khong chia het cho 5');
readln;
end.