Câu trả lời:
var n:qword;i:longint;
a:array[1..1000] of longint;
function du(x:qword):qword;
var k,d:longint;
begin
d:=0;
for k:=1 to trunc(sqrt(x)) do
begin
if x mod k=0 then
begin
d:=d+2;
end;
end;
if sqrt(x)=trunc(sqrt(x)) then dec(d);
du:=d;
end;
function tu(s:qword):qword;
var t:qword;j:longint;
begin
t:=0;
for j:=1 to trunc(sqrt(s)) do
if s mod j=0 then t:=t+j+(s div j);
tu:=t;
end;
begin
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
writeln(a[i],' co ',du(a[i]),' uoc. Tong uoc la: ',tu(a[i]));
readln;
end.