Problem 7
Problem 7
# Problem_7.py
"""
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?
第10001个质数是什么?
质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数。
"""
primes = [] for i in range(2, 999999):
flag = True
for x in range(2, i):
if i % x == 0:
flag = False
break
if flag:
print(i)
primes.append(i)
if len(primes) == 10001:
break print(primes)
print(primes[-1])
Problem 7的更多相关文章
- 1199 Problem B: 大小关系
求有限集传递闭包的 Floyd Warshall 算法(矩阵实现) 其实就三重循环.zzuoj 1199 题 链接 http://acm.zzu.edu.cn:8000/problem.php?id= ...
- No-args constructor for class X does not exist. Register an InstanceCreator with Gson for this type to fix this problem.
Gson解析JSON字符串时出现了下面的错误: No-args constructor for class X does not exist. Register an InstanceCreator ...
- C - NP-Hard Problem(二分图判定-染色法)
C - NP-Hard Problem Crawling in process... Crawling failed Time Limit:2000MS Memory Limit:262144 ...
- Time Consume Problem
I joined the NodeJS online Course three weeks ago, but now I'm late about 2 weeks. I pay the codesch ...
- Programming Contest Problem Types
Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and ...
- hdu1032 Train Problem II (卡特兰数)
题意: 给你一个数n,表示有n辆火车,编号从1到n,入站,问你有多少种出站的可能. (题于文末) 知识点: ps:百度百科的卡特兰数讲的不错,注意看其参考的博客. 卡特兰数(Catalan):前 ...
- BZOJ2301: [HAOI2011]Problem b[莫比乌斯反演 容斥原理]【学习笔记】
2301: [HAOI2011]Problem b Time Limit: 50 Sec Memory Limit: 256 MBSubmit: 4032 Solved: 1817[Submit] ...
- [LeetCode] Water and Jug Problem 水罐问题
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply a ...
- [LeetCode] The Skyline Problem 天际线问题
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...
- PHP curl报错“Problem (2) in the Chunked-Encoded data”解决方案
$s = curl_init(); curl_setopt($s, CURLOPT_POST, true); curl_setopt($s, CURLOPT_POSTFIELDS, $queryStr ...
随机推荐
- HDU 4510
省一等,保研. #include <iostream> #include <cstdio> #include <cstring> #include <algo ...
- Unity3D与JSP TomCatserver传递数据和文件( 二 ) Unity3D向java传输表单
扫码关注微信公众号,获取最新资源 经历了一天的工作.我又来更新啦...白天手欠,把上一个给删了.明天重写吧.. 废话不多说.我们先去Unity里创建一个能够输入username和password的登录 ...
- 贪吃蛇c++实现
近期没事翻了一下曾经写的程序.真是不堪入目.曾经真是什么都不懂.只是有一个程序倒是挺有意思的,大二的时候写的一个贪吃蛇游戏.尽管程序非常难看,还有非常多漏洞.但也是这个程序让我真正開始喜欢上了编程.不 ...
- Django 介绍、安装配置、基本使用、Django 用户注冊样例
Django介绍 Django 是由 Python 开发的一个免费的开源站点框架.能够用于高速搭建高性能.优雅的站点. DjangoMTV 的思想项目架构图 ...
- bootstrap 操作指南
1.table中显示级联类的属性显示 例如:java代码 public class MrTask { private Integer id: private User create_user; } p ...
- <vim实用技巧>学习笔记
第三章插入模式 1.插入模式下的删除 2.返回普通模式 3.复制 yt, //复制当前光标到逗号(,)之前的内容 第四章 可视模式 1 ...
- [APIO 2010] 巡逻
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1912 [算法] 树的直径 [代码] #include<bits/stdc++. ...
- 字符流、字节流、二进制及其在HTTP协议传输
一.二进制.字节.字符流概念 字(Byte)节是长度单位.位(bit)也是长度单位.计算机通信和存储的时候都是以010101这样的二进制数据为基础的二进制数有两个特点:它由两个基本字符0,1组成,二进 ...
- 爬虫—分析Ajax爬取今日头条图片
以今日头条为例分析Ajax请求抓取网页数据.本次抓取今日头条的街拍关键字对应的图片,并保存到本地 一,分析 打开今日头条主页,在搜索框中输入街拍二字,打开开发者工具,发现浏览器显示的数据不在其源码里面 ...
- Python金融量化
Python股票数据分析 最近在学习基于python的股票数据分析,其中主要用到了tushare和seaborn.tushare是一款财经类数据接口包,国内的股票数据还是比较全的 官网地址:http: ...