uses crt; var n,i,s:longint; begin clrscr; write(‘Nhap so luong phan tu: ‘);readln(n); write(‘Cac uoc so cua ‘,n,’: ‘); for i:=1 to n do if n mod i=0 then begin write(i,’ ‘); inc(s,i); end; writeln; write(‘Tong cac uoc so cua ‘,n,’: ‘,s); readln; end.
program tong_uoc;
uses crt;
var n,i,t:integer;
begin
clrscr;
write(‘Nhap N: ‘); readln(n);
write(‘Cac uoc cua ‘,n,’: ‘);
t:=0;
for i:=1 to n do
if n mod i=0 then
begin
write(i,’ ‘);
t:=t+i;
end;
writeln;
write(‘Tong cac uoc cua ‘,n,’ la: ‘,t);
readln;
end.
uses crt;
var n,i,s:longint;
begin
clrscr;
write(‘Nhap so luong phan tu: ‘);readln(n);
write(‘Cac uoc so cua ‘,n,’: ‘);
for i:=1 to n do if n mod i=0 then
begin
write(i,’ ‘);
inc(s,i);
end;
writeln;
write(‘Tong cac uoc so cua ‘,n,’: ‘,s);
readln;
end.