Program HOC24;
Program HOC24;
var a: array[1..50] of integer;
i,n: integer;
begin
write('Nhap so phan tu cua mang: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do if a[i] mod 2=1 then write(a[i],' '); writeln;
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' '); writeln;
for i:=1 to n do if (a[i] mod 2=1) and (i mod 2=0) then write(a[i],' ');
readln
end.
Đúng 1
Bình luận (0)