1.
uses crt;
var i,n,s:longint;
begin
clrscr;
write('n=');readln(n);
for i:=1 to n do s:=s+i;
writeln('s= ',s);
readln
end.
2.
uses crt;
var i,n,c,l:longint; a:array[1..1000000]of longint;
begin
clrscr;
write('n=');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
if a[i] mod 2=0 then inc(c,a[i]) else inc(l,a[i]);
end;
writeln('Tong cac so chan: ',c);
writeln('Tong cac so le: ',l);
readln
end.