1 Star 0 Fork 0

徒步天下 / EOJ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
3121.py 722 Bytes
一键复制 编辑 原始数据 按行查看 历史
徒步天下 提交于 2018-03-08 14:05 . 新建 3121.py
"""
3121. 素数
DESCRIPTION
STATISTICS
2 DISCUSSIONS
Time limit per test: 2.0 seconds
Memory limit: 256 megabytes
将 100~200 之间的素数输出 .
Input
NULL
Output
输出 100~200 之间的素数 .
Examples
Input
NULL
Output
NULL
"""
## 这题坑在输出要求以空格分开,最后一个数字后没有空格
def prime(n):
x = 2
result = True
while x*x <= n:
if n % x == 0:
result = False
break
x += 1
return result
first = True
for n in range(100, 201):
if prime(n):
if first:
first = False
print(n, end="")
else:
print("", n, end="")
1
https://gitee.com/se17a/EOJ.git
git@gitee.com:se17a/EOJ.git
se17a
EOJ
EOJ
master

搜索帮助