100-1000 素数之和

问题描述:

100-1000 素数之和

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.