Program HOC24;
var i,n: integer;
t,t1: longint;
begin
readln(n);
for i:=1 to n do
if n mod i=0 then write(i,' ');
writeln;
for i:=1 to n do
if (n mod i =0) and (i mod 2=0) then
begin
write(i,' ');
t:=t+i;
end;
write('; tong cua chung la : ',t);
writeln;
for i:=1 to n do
if n mod i=0 then write(i,' ');
writeln;
for i:=1 to n do
if (n mod i =0) and (i mod 2<>0) then
begin
write(i,' ');
t:=t+i;
end;
write('; tong cua chung la : ',t);
readln
end.
uses crt;
var n,i,t,t1:integer;
begin
clrscr;
write('Nhap n='); readln(n);
writeln('Cac uoc cua ',n,' la: ');
for i:=1 to n do
if n mod i=0 then write(i:4);
writeln;
t:=0;
writeln('Cac uoc chan cua ',n,' la: ');
for i:=1 to n do
if (n mod i=0) and (i mod 2=0) then
begin
t:=t+i;
write(i:4);
end;
writeln;
writeln('Tong cac uoc chan cua ',n,' la: ',t);
t1:=0;
writeln('Cac uoc le cua ',n,' la: ');
for i:=1 to n do
if (n mod i=0) and (i mod 2=1) then
begin
t1:=t1+i;
write(i:4);
end;
writeln;
writeln('Tong cac uoc le cua ',n,' la: ',t1);
readln;
end.