您的位置:首页 > 其它

求连续十个最小的合数

2015-07-10 09:43 357 查看
program p1;var a,b,s,n:integer; yes:boolean;procedure sub(x:integer;var yy:boolean);var k,m:integer;begin k:=trunc(sqrt(x)); for m:=3 to k do if odd(m) then if x mod m=0 then yy:=false;end;begin b:=3; repeat a:=b; repeat yes:=true; inc(b,2); sub(b,yes); if yes then s:=b-a; until yes; until s>=10; for n:=a+1 to a+10 do write(n:6); writeln;end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: