Function GetZhiShu(Const M: Integer):String;
begin
Result:='1'+',';
For i:= 1 to M do
if M mod i <> 0 then
Result:=Result+ inttostr(i)+',';
Result:=Result+inttostr(M);
end;
begin
Result:='1'+',';
For i:= 1 to M do
if M mod i <> 0 then
Result:=Result+ inttostr(i)+',';
Result:=Result+inttostr(M);
end;
我的这个都是天文数学,不可能单个循环的。
4.x*(10的18次方)吧
有没有大过longint的整数?
{printf("input number(2~32767):");
scanf("%d",&m);
k=sqrt(m);
for(i=2;i<=k;i++)
if(m%i==0) break;
if(i>=k+1) total=total+1;
}total是统计质数的个数的
快呀,3怎么处理,能处理吗?改了时间,19:30结贴,请大家快点回答!
最大的了,再大就要用实数处理了
Extended3.6 x 10^?951 .. 1.1 x 10^4932