讨论 / 水题——质因数分解
Marx2002 2016-09-10 22:37:02
点我顶贴 收藏 删除
var n,i:longint;

function find(x:longint):longint;

var i:longint;

begin

find:=0;

for i:=2 to trunc(sqrt(x)) do

if n mod i=0 then begin find:=1; break; end;

end;

begin

readln(n);

for i:=2 to trunc(sqrt(n)) do

if (n mod i=0) and (find(i)=0) then break;

write(n div i);

end.

查看更多回复
提交回复