data;
x=2;
put x;
do x = 3 to 10000 by 2;
i=3;
do while (mod(x,i)^=0);
i=i+2;
end;
if i>=x then put x;
end;
run;
我是这样写的:
%MACRO M(N);
data;
x=2;
put x;
do x = 3 to &N;
i=3;
do while (mod(x,i)^=0);
i=i+2;
end;
if i>=x then put x ;
end;
run;
%MEND M;
%M(10);
运行时尝试令N=10,结果输出2和3后就卡住了。
求指导!谢谢!



雷达卡




京公网安备 11010802022788号







