提交 24d58378 编写于 作者: [小G]'s avatar [小G] 🚴🏽

添加文章:质数

上级 9218ae18
此差异已折叠。
此差异已折叠。
---
title: 质数
description: 关于求质数的基本方法,如何判断质数、筛选质数
tags:
- 质数
categories:
- 算法
- 数学知识
abbrlink: 4c75c6b3
date: 2021-09-17 10:18:12
cover: https://gitee.com/ajream/images/raw/master/img/20210917104053_algorithm2.png
---
## 质数
### 试除法判定质数
代码模板
```c
bool is_prime(int x){
if(x<2) return false;
for(int i=2; i<= x / i; ++i){
if(x % i == 0)
return false;
}
return true;
}
```
### 试除法分解质因数
### 朴素筛选法筛选质数
### 线性筛选法筛选质数
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册