Bài 1
Var a:array:[1..1000] of integer;
i,n:integer;
p:longint;
Begin
p:=1;
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
if a[i] mod 2 = 0 then p:=p*a[i];
End;
Write('Tich cac so chan la: ',p);
Write('Day viet nguoc lai la ');
For i:=n downto 1 do
Write(a[i]:8);
Readln
End.
program TinhTichVaInDaoNguoc;
var a: array[1..1000] of integer;
i, n: integer;
s: longint;
begin
s := 1;
write'(nhap vao n : ');
readln(n);
for i := 1 to n do
begin
write('Nhap so thu ', i, ' = ');
readln(a[i]);
if a[i] mod 2 = 0 then
s := s * a[i];
end;
writeln('Tich cac so chan la: ', s);
writeln('Day viet nguoc lai la: ');
for i := n downto 1 do
write(a[i]:8);
readln;
end.