(Problem 7)10001st prime
来源:互联网 发布:淘宝宝贝视频怎么制作 编辑:程序博客网 时间:2024/05/29 02:18
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
#include <stdio.h>#include <string.h>#include <ctype.h>#include <math.h> int prim(int n){ int i; for(i=2; i*i<=n; i++) { if(n%i==0) return 0; } return 1;} void solve(int n){ int i=2; int count=0; while(1) { if(prim(i)) { count++; if(count==n) break; } i++; } printf("%d\n",i);} int main(){ int n=10001; solve(n); return 0;}
Answer:
104743- (Problem 7)10001st prime
- Problem 7:10001st prime
- Problem 7 10001st prime
- Problem 7 10001st prime (线性筛)
- 【Project Euler】【Problem 7】10001st prime
- projecteuler---->problem=7----10001st prime
- Project Euler Problem 7: 10001st prime
- ProjectEuler-Problem 7-10001st prime
- PE 7 10001st prime
- 欧拉计划(7)10001st prime
- 7 10001st prime - Project Euler
- project euler 7 10001st prime
- Problem 7 of What is the 10 001st prime number?
- 欧拉项目第7题 10001st prime
- Project Euler 007 10001st prime
- (Problem 41)Pandigital prime
- Prime Ring Problem(DFS)
- hdu1016(Prime Ring Problem)
- cocos2d-x根据点击的位置来拖动精灵
- 为学Android,我看了这些书
- delphi控件安装与删除
- iOS开发:接触IOS的第一个组件UILabel (常用属性)
- JSON之解析通过TouchJSON\SBJSON\JSONKit\NSJSONSeriliz...
- (Problem 7)10001st prime
- 设置select下拉框的宽度
- centos搭建J2EE_CMS运行环境(jdk +tomcat +mysql配置)
- mail command not found
- Android Layout属性
- Linux输入子系统
- CRF++条件随机场 总结
- http://write.blog.csdn.net/postedit
- mvc几种开发模式