matlab 编写程序求完数

2025-03-10 09:41:41
推荐回答(1个)
回答1:

clc
temp=0;
wanshu=0;
for j=1:10000
for k=1:j-1
if mod(j,k)==0;
temp=[temp k];
end
end
if j==sum(temp);
wanshu=[wanshu j];
end
temp=0;
end
disp(wanshu);

答案 6 28 496 8128