当前位置:网站首页>聪明人的游戏提高篇:第三章第三课例题:素数的秘密(prime)
聪明人的游戏提高篇:第三章第三课例题:素数的秘密(prime)
2022-07-22 20:10:00 【闪耀的天狼星】
#include <iostream>
#include <cstdio>
using namespace std;
int n,i,j,k;
int t(int a)
{
for (j=2;j*j<=a;j++)
if (a%j==0)
return 0;
return 1;
}
int main()
{
cin >>n;
for (i=2;i<=n;i++)
{
if (t(i))
{
cout <<i <<" ";
k++;
if (k%5==0)
cout <<endl;
}
}
return 0;
}边栏推荐
- 电脑如何快速关机 电脑关机命令分享
- Unity 笔记——Addressables的使用
- How to restore the computer screen display zoom tutorial when the computer screen becomes larger
- 分享一个qt实现的登录界面模板
- What is the difference between GPU and CPU? Introduction to the meaning of GPU in different computers
- 标签平滑(label smoothing)
- session、cookie、token 详解
- 基于以太坊状态数据库的攻击与防御方案
- LUR缓存算法
- telnet不是内部或外部命令怎么解决 telnet不是内部或外部命令解决办法
猜你喜欢

Kotlin learning quick start (8) - Delegation

Zhimeng dedecms forgot to manage the background password retrieval method

Gb28181 summary of common problems in the use and secondary development of livegbs streaming media service

threejs+shader绘制常用的图形

对线程池的了解与应用你掌握多少

C语言 程序环境

vim文本编辑器

上采样方式(反卷积、插值、反池化)

Google cloud and Oracle cloud are "hot"? It is imperative to deploy cross cloud disaster recovery!

小黑啃leetcode:589. N 叉树的前序遍历
随机推荐
动作活体检测能力,构建安全可靠的支付级“刷脸”体验
Image processing solution veimagex technology evolution Road
redis常用基础配置文件
【FAQ】应用内支付服务无法拉起支付页面常见原因分析和解决方法
XSS essential knowledge
Livegbs design document of security camera internet live broadcast scheme
Cloudwego's design practice in the background platform of flybook management
你的 NFT 会消失吗?DFINITY 提供 NFT 存储最佳方案
Analysis of cache read and write strategy
国泰君安证券股票开户怎么样安全吗
The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience
Analyse de la stratégie de lecture et d'écriture du cache
Vector3.Lerp
gnu 伪指令定义函数
Null and nullptr
redis的持久化
ESP32教程(一):VScode+platformIO和Vscode+ESP-IDF两种开发环境搭建
Face algorithms
Gb28181 summary of common problems in the use and secondary development of livegbs streaming media service
【高并发基石】多线程、守护线程、线程安全、线程同步、互斥锁