

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
program ct;
uses crt;
var a,b,tong,tich,hieu:integer;
begin
clrscr;
readln(a,b);
if a and b mod 2=0 then tong:=a+b;
writeln('tong la',tong);
if a and b mod 2<>0 then tich:=a*b;
writeln('tich la',tich);
if a mod 2=0 and b mod 2<>0 then hieu:=b-a
writeln(' hieu la',hieu);
readln;
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
uses crt;
var
a,b,tong,tich,hieu: longint;
begin
clrscr;
write('nhap a,b=');
readln(a,b);
if (a mod 2=0) and (b mod 2=0) then tong:=a+b
else ('khong la so chan');
writeln(tong);
if (a mod 2=1) and (b mod 2=1) then tich:=a*b
else ('khong la so le');
writeln(tich);
if (a mod 2=0) and (b mod 2=1) then hieu:=b-a
else ('khong la so chan and so le');
writeln( hieu);
readln;
end.
CHUC BAN HOC TOT
NHO CHO "CTLN" NHA BRO
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Bảng tin