1:
uses crt;
var a:array[1..100]of integer;
i,n,dem,t:integer;
tb:real;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
dem:=0;
for i:=1 to n do
if a[i]>0 then
begin
t:=t+a[i];
inc(dem);
end;
writeln('Tong cac so duong la: ',t);
writeln('So luong cac so duong la: ',dem);
tb:=t/dem;
writeln('Trung binh cong cac so duong la: ',tb:4:2);
readln;
end.
2:
uses crt;
var n,i,s:integer;
t:real;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
t:=1;
for i:=1 to n do
begin
s:=s+i;
t:=t*i;
end;
writeln('Tong cua day so tu 1 toi ',n,' la: ',s);
writeln('Tich cua day so tu 1 toi ',n,' la: ',t);
readln;
end.