Câu 1
uses
crt;
var a : integer;
begin
clrscr;
write('nhap a ='); readln(a);
if a mod 2 = 0 then writeln('la so chan ') else
writeln('la so le ');
readln;
end.
1:
uses crt;
var n:integer;
begin
clrscr;
write('n='); readln(n);
if n>=0 then begin
if n mod 2=0 then writeln(n,' la so chan')
else writeln(n,' la so le');
end
else writeln('vui long nhap so tu nhien');
readln;
end.
2:
uses crt;
var d,r,cv,dt:integer;
begin
clrscr;
write('nhap chieu dai:'); readln(d);
write('nhap chieu rong:'); readln(r);
if (d>0) and (r>0) and (d>=r) then
begin
cv:=(d+r)*2;
dt:=d*r;
writeln('chu vi la: ',cv);
writeln('dien tich la: ',dt);
end
else writeln('vui long nhap lai');
readln;
end.