program DanhSachB;
const
MAX = 100;
type
Mang = array[1..MAX] of integer;
var
B: Mang;
i, n, tongLe, demAm: integer;
procedure NhapDanhSach(var B: Mang; var n: integer);
begin
writeln('Nhap so phan tu cua danh sach B: ');
readln(n);
writeln('Nhap cac phan tu cua danh sach B: ');
for i := 1 to n do
readln(B[i]);
end;
function TongSoLe(B: Mang; n: integer): integer;
var
tong: integer;
begin
tong := 0;
for i := 1 to n do
if B[i] mod 2 <> 0 then
tong := tong + B[i];
TongSoLe := tong;
end;
function DemSoPhanTuAm(B: Mang; n: integer): integer;
var
dem: integer;
begin
dem := 0;
for i := 1 to n do
if B[i] < 0 then
dem := dem + 1;
DemSoPhanTuAm := dem;
end;
begin
NhapDanhSach(B, n);
tongLe := TongSoLe(B, n);
writeln('Tong cac so le trong danh sach B la: ', tongLe);
demAm := DemSoPhanTuAm(B, n);
writeln('So luong phan tu am trong danh sach B la: ', demAm);
end.