主题:请教一个完全数程序问题?
declare function fun( j as integer ) as integer
dim as integer j,l
dim shared as integer k,p,a(20),i
for j=10 to 1000
'a(1)=1
l= fun(j)
if j=l then print j
next j
sleep
function fun( j as integer) as integer
k=0
p=1
for i=2 to j\2
while ((j mod i)=0)
k=k+1
a(k)=i
j=j/i
p=p+a(k)
wend
next i
return p
end function
这个程序运行后没有结果???
dim as integer j,l
dim shared as integer k,p,a(20),i
for j=10 to 1000
'a(1)=1
l= fun(j)
if j=l then print j
next j
sleep
function fun( j as integer) as integer
k=0
p=1
for i=2 to j\2
while ((j mod i)=0)
k=k+1
a(k)=i
j=j/i
p=p+a(k)
wend
next i
return p
end function
这个程序运行后没有结果???