uses crt; var a:array[1..100] of integer;k,i:integer;p:longint; begin clrscr; write(‘Nhap so luong phan tu: ‘); readln(k); p:=1; for i:=1 to k do begin write(‘Nhap so o vi tri ‘,i,’: ‘); readln(a[i]); end; write(‘Nhung so o vi tri le: ‘); p:=1; for i:=1 to k do if i mod 2=1 then begin write(a[i],’ ‘); p:=p*a[i]; end; writeln; write(‘Tich cac so do: ‘,p); readln; end.
program tich_so_le;
uses crt;
var A:array[1..1000] of integer;
k,i:integer;
tich:longint;
begin
clrscr;
write(‘Nhap k: ‘); readln(k);
tich:=1;
for i:=1 to k do
begin
write(‘Nhap so thu ‘,i,’: ‘); readln(A[i]);
end;
write(‘Cac so o vi tri le la: ‘);
tich:=1;
for i:=1 to k do
if i mod 2=1 then
begin
write(A[i],’ ‘);
tich:=tich*A[i];
end;
writeln;
write(‘Tich cac so o vi tri le la: ‘,tich);
readln;
end.
uses crt;
var a:array[1..100] of integer;k,i:integer;p:longint;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘); readln(k);
p:=1;
for i:=1 to k do
begin
write(‘Nhap so o vi tri ‘,i,’: ‘); readln(a[i]);
end;
write(‘Nhung so o vi tri le: ‘);
p:=1;
for i:=1 to k do
if i mod 2=1 then
begin
write(a[i],’ ‘);
p:=p*a[i];
end;
writeln;
write(‘Tich cac so do: ‘,p);
readln;
end.