poj2739
来源:互联网 发布:网络运营师在哪里考? 编辑:程序博客网 时间:2024/05/16 05:20
/*
分析:
水题,不说了。
2012-07-30 17:07
*/
分析:
水题,不说了。
2012-07-30 17:07
*/
#include"stdio.h"#include"string.h"int num[10011];int prime[3333],k;int main(){int n;int i,l,temp;int ans;for(i=0;i<=10000;i++)num[i]=1;num[0]=num[1]=0;k=0;for(i=2;i<=10000;i++){if(num[i]){prime[k++]=i;for(temp=2*i;temp<=10000;temp+=i)num[temp]=0;}}while(scanf("%d",&n),n){ans=0;for(i=0;prime[i]<=n;i++){temp=n;for(l=i;l<k;l++){temp-=prime[l];if(!temp){ans++;break;}if(temp<0)break;}}printf("%d\n",ans);}return 0;}
- poj2739
- poj2739
- poj2739
- poj2739
- poj2739
- poj2739
- poj2739
- poj2739
- poj2739
- POJ2739
- POJ2739
- POJ2739
- poj2739
- poj2739
- POJ2739
- poj2739
- poj2739
- poj2739
- jQuery Color Animate (jQuery 颜色变换动画) 插件
- HTML Canvas 绘制五角星
- OpenGL函数功能-->glutTimerFunc()
- 关系型数据库到HBase的数据储存方式变迁
- uva 193 - Graph Coloring
- poj2739
- 广西科技职业学院“创业大学建设研究试验区”揭牌仪式隆重举行
- 设置iframe无边框
- Intent 传值和 Bundle传值的区别
- 很久登CSDN了
- Hibernate Reverse Engineering生成ORM持久化类的问题
- Android解析Xml字符串例子
- HBase 性能调优
- Linux系统下如何查看及修改文件读写权限