1007
来源:互联网 发布:python twisted下载 编辑:程序博客网 时间:2024/05/17 23:29
#include<iostream>#include<vector>#include<string>using namespace std;bool ptable[100000];int main(){freopen("in.txt","r",stdin);int n;cin>>n;ptable[0]=ptable[1]=1;int cnt=0;if(n<=2){cout<<0<<endl;return 0;}for(int i=2;i<=n;i++){if(ptable[i]==0){if(ptable[i-2]==0) cnt++;for(int j=2*i;j<=n;j+=i){ptable[j]=1;}}}cout<<cnt<<endl;}
0 0
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- 1007
- [golang]自己动手实现ini文件读取
- JFreeChart的使用
- 为什么要使用SVN
- 黑马程序员_7K面试题之银行调度业务
- PAT_1016
- 1007
- 用ThinkPHP框架遇到的狗血bug:包含common.php时报函数重复声明的错误。
- python文件与目录操作方法大全
- mysql启动过程中报错
- 斐波那契数列
- 大神oracle体系结构详解
- 双向链表的实现
- resin 入门笔记
- Firefox插件中invoke方法获取参数以及参数转化