求连续十个最小的合数
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.
相关文章推荐
- 移梵塔
- 内存释放
- Linux:no link present,check cable
- 几种SQL语句的写法
- NSUserDefaults用法(轻量级本地数据存储)
- 限制页面请求在一定时间内的访问次数
- 每天进步一点点——linux——sed
- NYOJ 70-阶乘因式分解(二)
- jdk阅读xml文件
- NSUserDefaults用法(轻量级本地数据存储)
- echarts 版本区分导致的错误
- Oracle to_char格式化函数 显示毫秒
- IOS基础:IOS及ObjectC基础知识
- 互联网名词解释
- java web 拦截器与过滤器区别
- 2015.7.10js-07(简单时间)
- 【Python】python环境的搭建之windows篇
- 十大游戏开发引擎
- 安卓开发规范
- ssh关于hibernate的几点问题