1007_素数对猜想 (20)
来源:互联网 发布:mac如何把照片拷到u盘 编辑:程序博客网 时间:2024/06/05 04:09
#include<stdio.h>#include<math.h>int isprime(int n){int i;for(i=2;i<=sqrt(n);i++)if(n%i==0) return 0;return 1;}int main(){int n,i,sum,t;while(~scanf("%d",&n)){if(n>=100000||n<1) continue;sum=0;t=3;for(i=4;i<=n;i++)if(isprime(i)){if((i-t)==2) sum++;t=i;}printf("%d\n",sum);}return 0;}
0 0
- 1007_素数对猜想 (20)
- 1007 素数对猜想
- 1007素数对猜想
- 1007 素数对猜想
- 1007 素数对猜想
- 素数对猜想 (20)
- PAT 1007 素数对猜想 (20)
- PAT乙级1007:素数对猜想 (20)
- PAT乙级 1007 素数对猜想 (20)
- PAT_自测2_素数对猜想
- PAT 1007 素数对猜想
- 1007 素数对的猜想
- PAT 1007 素数对猜想
- PAT_1007. 素数对猜想 (20)
- 1007. 素数对猜想 (20)
- 1007. 素数对猜想 (20)
- 1007. 素数对猜想 (20)
- 1007. 素数对猜想 (20)
- 【Dokan学习记录】2015-01-30
- 用数组来算大整数的加法
- Windows程序设计第五版 读书体会
- resteasy-spring + springmvc + extdirectspring配置
- Makefile.am、Makefile.in和Makefile的关系
- 1007_素数对猜想 (20)
- Embedded Linux Conference schedule announced, several talks from Free Electrons
- poj 2608 Soundex
- 工作日志
- Android TextView(EditView)文字底部或者中间 加横线
- 获取JSON对象的属性值
- UVA Foreign Exchange(排序)
- gdb如何调试没有符号表(未加-g选项的编译)的程序
- poj 2612 Mine Sweeper