program Tin;
uses crt;
var i,tong,tongle,tongchan:integer;
n:byte;
a: array [1..100] of integer;
begin
clrscr;
tong:=0;tongchan:=0;tongle:=0;
write('Nhap N(N<=100) : ');readln(n);
while n>100 do
begin
write('Nhap lai: ');readln(n)
end;
writeln('Nhap ',n,' so nguyen');
for i:= 1 to n begin
write('1000> a[',i,'] > -1000 = ');
readln(a[i]);
while n>=1000 do
begin
write('Nhap lai: ');readln(a[i])
end;
while n<=1000 do
begin
write('Nhap lai: ');readln(a[i])
end;
tong:=tong+a[i];
if a[i] mod 2 = 0 then tongchan:=tongchan+a[i] else tongle:=tongle+a[i]
end;
writeln('Tong cac so nguyen chan la: ',tongchan);
writeln('Tong cac so nguyen le la: ',tongle);
writeln('Tong gia tri cua day so la: ',tong);
readln;
end.