dataxx(drop=i);count=0;
do i=1 to 1000;
doj=1 to i;
ifmod(i,j)=0 then count=count+1;
ifcount=2 then output ;
end;
end;
run;
proc print;
run;
自己编的程序好像有问题,求高人指点。
|
楼主: 木英hello
|
6766
5
[求助] 用sas编写1到1000的质数。 |
|
已卖:1份资源 高中生 90%
-
|
回帖推荐biyanyidao 发表于4楼 查看完整内容 data xx;
do i=1 to 1000;
count=0;
do j=1 to i;
if mod(i,j)=0 then count+1;
end;
if count=2 then output;
end;
drop count j;
run;
proc print;
run;
程序改成这样可以运行
| ||
|
|
| ||
| ||
| ||
扫码京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


