> 其他 >
100-1000 素数之和
人气:193 ℃ 时间:2020-05-12 14:25:24
解答
pascal:
var
s,i,x,t:longint;
begin
s:=0;
for x:=100 to 1000 do begin
t:=0;
for i:=1 to x do if x mod i=0 then t:=t+1;
if t=2 then s:=s+x;
end;
writeln('S=',s);
end.
推荐
猜你喜欢
© 2026 79432.Com All Rights Reserved.
电脑版|手机版